diff --git a/packages/redux/mixin.runtime-common.js b/packages/redux/mixin.runtime-common.js index 2e59b6d5f..e87462ee6 100644 --- a/packages/redux/mixin.runtime-common.js +++ b/packages/redux/mixin.runtime-common.js @@ -10,11 +10,12 @@ const { class ReduxRuntimeCommonMixin extends Mixin { constructor(config, element, { redux: options = {} } = {}) { super(config); - this.middlewares = options.middlewares; + this.middlewares = options.middlewares || []; } getReduxMiddlewares() { return [ + ...this.middlewares, ReduxThunkMiddleware.withExtraArgument({ config: this.config, }), @@ -22,7 +23,7 @@ class ReduxRuntimeCommonMixin extends Mixin { } applyMiddlewares() { - const middlewares = this.middlewares || this.getReduxMiddlewares(); + const middlewares = this.getReduxMiddlewares(); return middlewares.map(m => applyMiddleware(m)); }