diff options
author | Noah Loomans <noahloomans@gmail.com> | 2018-07-03 22:05:14 +0200 |
---|---|---|
committer | Noah Loomans <noahloomans@gmail.com> | 2018-07-03 22:05:14 +0200 |
commit | 4f7bd934ec97bb240239abc4ce8e18ef01546ece (patch) | |
tree | bb6804dc317075a7bbbc6c9fb0e3be1383683f33 /src/client/react/lib | |
parent | bb9ecd90442ef7827c5620dd9d354ee48716e4db (diff) |
client: Move middleware creation to seperate file
Diffstat (limited to 'src/client/react/lib')
-rw-r--r-- | src/client/react/lib/reduxMiddleware.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/client/react/lib/reduxMiddleware.js b/src/client/react/lib/reduxMiddleware.js new file mode 100644 index 0000000..c153022 --- /dev/null +++ b/src/client/react/lib/reduxMiddleware.js @@ -0,0 +1,11 @@ +import moment from 'moment'; +import { applyMiddleware } from 'redux'; +import thunk from 'redux-thunk'; +import makeGetHistory from './getHistory'; + +export default function makeReduxMiddleware({ history }) { + return applyMiddleware(thunk.withExtraArgument({ + getHistory: makeGetHistory(history), + moment, + })); +} |