Skip to content

Commit aa16092

Browse files
committed
actually we need this
1 parent e1f58d4 commit aa16092

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

redisinsight/ui/src/utils/test-store.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,19 @@ const getState: ReduxStore['getState'] = () => {
2222
return storeRef.getState()
2323
}
2424

25-
export const dispatch: AppDispatch = (action) => {
25+
// `action: any` because `AppDispatch` is an intersection of `ThunkDispatch`
26+
// overloads — TypeScript can't infer a single parameter type across the
27+
// overload set, so a direct `(action) => ...` form fails with TS7006. The
28+
// outer `as AppDispatch` keeps the exported binding correctly typed for
29+
// callers.
30+
export const dispatch = ((action: any) => {
2631
if (!storeRef) {
2732
throw new Error(
2833
'Store not initialized. Make sure store-dynamic is imported after store creation.',
2934
)
3035
}
3136
return storeRef.dispatch(action)
32-
}
37+
}) as AppDispatch
3338

3439
const subscribe: ReduxStore['subscribe'] = (listener: () => void) => {
3540
if (!storeRef) {

0 commit comments

Comments
 (0)