Closed
Description
I have a custom enhancer with the following signature:
export interface ExtraProperties<PS> {
persistence: {
getPersistentState: () => PS
hydrate: (state: PS) => void
flush: () => void
}
}
const enhancer = (createStore: StoreEnhancerStoreCreator): StoreEnhancerStoreCreator<ExtraProperties<PS>> => {
return <S = any, A extends Action = AnyAction>(
reducer: Reducer<S, A>,
preloadedState?: PreloadedState<S>
) => {
...
}
}
However when I add this enhancer to configureStore
, the type of the returned store doesn't change at all.
This is caused by the fact that configureStore has type parameters for the state, actions and middleware, but not for the enhancer.
Metadata
Metadata
Assignees
Labels
No labels