Closed
Description
What is the current behavior?
export type StoreEnhancerStoreCreator<S> = (reducer: Reducer<S>, preloadedState?: S, enhancer?: StoreEnhancer<S>) => Store<S>;
Does not allow an enhancer argument, therefore the
This doesn't let you create a enhancer like https://github.com/reactjs/redux/blob/master/src/applyMiddleware.js
with typescript, since you can't chain the enhancers.
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://jsfiddle.net or similar.
import * as Redux from "redux";
interface State {}
export const enhancer: Redux.StoreEnhancer<State> = createStore => (reducer, preloadedState, enhancer?) => {
return createStore(reducer, preloadedState, enhancer) ;
}
Does not compile.
What is the expected behavior?
Should compile.
Which versions of Redux, and which browser and OS are affected by this issue? Did this work in previous versions of Redux?
3.6.0
Given #1648 I may be missing something, but I think changing it to
export type StoreEnhancerStoreCreator<S> = (reducer: Reducer<S>, preloadedState?: S, enhancer?: StoreEnhancer<S>) => Store<S>;`
would be enough until that issue is resolved.
Metadata
Metadata
Assignees
Labels
No labels