Merge branch 'enhancer' into return-to-ts
This commit is contained in:
commit
85e478c02f
@ -322,7 +322,10 @@ export class Updux {
|
||||
};
|
||||
}
|
||||
|
||||
createStore(initial?: unknown) {
|
||||
createStore(initial?: unknown, enhancerGenerator?: Function) {
|
||||
|
||||
const enhancer = (enhancerGenerator ?? applyMiddleware)(this.middleware);
|
||||
|
||||
const store : {
|
||||
getState: Function & Record<string,Function>,
|
||||
dispatch: Function & Record<string,Function>,
|
||||
@ -331,7 +334,7 @@ export class Updux {
|
||||
} = reduxCreateStore(
|
||||
this.reducer,
|
||||
initial ?? this.initial,
|
||||
applyMiddleware(this.middleware)
|
||||
enhancer
|
||||
) as any;
|
||||
|
||||
store.actions = this.actions;
|
||||
|
Loading…
Reference in New Issue
Block a user