about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/store
diff options
context:
space:
mode:
Diffstat (limited to 'app/javascript/flavours/glitch/store')
-rw-r--r--app/javascript/flavours/glitch/store/configureStore.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/app/javascript/flavours/glitch/store/configureStore.js b/app/javascript/flavours/glitch/store/configureStore.js
new file mode 100644
index 000000000..1376d4cba
--- /dev/null
+++ b/app/javascript/flavours/glitch/store/configureStore.js
@@ -0,0 +1,15 @@
+import { createStore, applyMiddleware, compose } from 'redux';
+import thunk from 'redux-thunk';
+import appReducer from '../reducers';
+import loadingBarMiddleware from '../middleware/loading_bar';
+import errorsMiddleware from '../middleware/errors';
+import soundsMiddleware from '../middleware/sounds';
+
+export default function configureStore() {
+  return createStore(appReducer, compose(applyMiddleware(
+    thunk,
+    loadingBarMiddleware({ promiseTypeSuffixes: ['REQUEST', 'SUCCESS', 'FAIL'] }),
+    errorsMiddleware(),
+    soundsMiddleware()
+  ), window.devToolsExtension ? window.devToolsExtension() : f => f));
+};