diff --git a/src/Updux.ts b/src/Updux.ts index fbb65d3..82b0d88 100644 --- a/src/Updux.ts +++ b/src/Updux.ts @@ -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, dispatch: Function & Record, @@ -331,7 +334,7 @@ export class Updux { } = reduxCreateStore( this.reducer, initial ?? this.initial, - applyMiddleware(this.middleware) + enhancer ) as any; store.actions = this.actions;