aboutsummaryrefslogtreecommitdiff
path: root/src/client/react/lib
diff options
context:
space:
mode:
authorNoah Loomans <noahloomans@gmail.com>2018-07-03 22:05:14 +0200
committerNoah Loomans <noahloomans@gmail.com>2018-07-03 22:05:14 +0200
commit4f7bd934ec97bb240239abc4ce8e18ef01546ece (patch)
treebb6804dc317075a7bbbc6c9fb0e3be1383683f33 /src/client/react/lib
parentbb9ecd90442ef7827c5620dd9d354ee48716e4db (diff)
client: Move middleware creation to seperate file
Diffstat (limited to 'src/client/react/lib')
-rw-r--r--src/client/react/lib/reduxMiddleware.js11
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,
+ }));
+}