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 : {
|
const store : {
|
||||||
getState: Function & Record<string,Function>,
|
getState: Function & Record<string,Function>,
|
||||||
dispatch: Function & Record<string,Function>,
|
dispatch: Function & Record<string,Function>,
|
||||||
@ -331,7 +334,7 @@ export class Updux {
|
|||||||
} = reduxCreateStore(
|
} = reduxCreateStore(
|
||||||
this.reducer,
|
this.reducer,
|
||||||
initial ?? this.initial,
|
initial ?? this.initial,
|
||||||
applyMiddleware(this.middleware)
|
enhancer
|
||||||
) as any;
|
) as any;
|
||||||
|
|
||||||
store.actions = this.actions;
|
store.actions = this.actions;
|
||||||
|
Loading…
Reference in New Issue
Block a user