redux-state-sync
redux-state-sync copied to clipboard
TypeScript typing wrong in returned store after wrapping reducers with withReduxStateSync()
const store = createStore(reducers, defaultState, enhancers);
store
is Store<CombinedState<ApplicationState>, AnyAction> & {dispatch: unknown}
Once I wrap reducers
in withReduxStateSync()
, store
is Store<Reducer<any, AnyAction>, AnyAction> & {dispatch: unknown}
.
If I totally erase the typings it works:
const store = (createStore(
reducers,
defaultState,
enhancers
) as unknown) as Store<CombinedState<ApplicationState>, AnyAction> & {
dispatch: unknown;
};
Thanks for pointing this out. Currently, the type is a bit wrong, need to support generic types. let me add it in.