add enhancer
This commit is contained in:
parent
55812ed6d8
commit
a8f97940e8
@ -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