Skip to content

Commit

Permalink
fix(redux): always add redux-thunk middlware
Browse files Browse the repository at this point in the history
  • Loading branch information
jhiode authored and ZauberNerd committed Apr 16, 2019
1 parent 06c1ec5 commit 900edc7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/redux/mixin.runtime-common.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,20 @@ 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,
}),
];
}

applyMiddlewares() {
const middlewares = this.middlewares || this.getReduxMiddlewares();
const middlewares = this.getReduxMiddlewares();

return middlewares.map(m => applyMiddleware(m));
}
Expand Down

0 comments on commit 900edc7

Please sign in to comment.