File tree Expand file tree Collapse file tree
redisinsight/ui/src/utils Expand file tree Collapse file tree Original file line number Diff line number Diff 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
3439const subscribe : ReduxStore [ 'subscribe' ] = ( listener : ( ) => void ) => {
3540 if ( ! storeRef ) {
You can’t perform that action at this time.
0 commit comments