about summary refs log tree commit diff
path: root/app/assets/javascripts/components/store
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-09-19 23:25:59 +0200
committerEugen Rochko <eugen@zeonfederated.com>2016-09-19 23:26:21 +0200
commit337462aa5e68014aa15788e4513e190b2e434d7e (patch)
treea760e80e2bc9b1fef55f118ddeb8603b20155a61 /app/assets/javascripts/components/store
parentf820edb463109e313e836d8e2f210927a0eba7d1 (diff)
Re-organizing components to be more modular, adding loading bars
Diffstat (limited to 'app/assets/javascripts/components/store')
-rw-r--r--app/assets/javascripts/components/store/configureStore.jsx11
1 files changed, 7 insertions, 4 deletions
diff --git a/app/assets/javascripts/components/store/configureStore.jsx b/app/assets/javascripts/components/store/configureStore.jsx
index 1f2fcf2cf..89f498217 100644
--- a/app/assets/javascripts/components/store/configureStore.jsx
+++ b/app/assets/javascripts/components/store/configureStore.jsx
@@ -1,7 +1,10 @@
 import { createStore, applyMiddleware, compose } from 'redux';
-import thunk from 'redux-thunk';
-import appReducer from '../reducers';
+import thunk                                     from 'redux-thunk';
+import appReducer                                from '../reducers';
+import { loadingBarMiddleware }                  from 'react-redux-loading-bar';
 
 export default function configureStore(initialState) {
-  return createStore(appReducer, initialState, compose(applyMiddleware(thunk), window.devToolsExtension ? window.devToolsExtension() : f => f));
-}
+  return createStore(appReducer, initialState, compose(applyMiddleware(thunk, loadingBarMiddleware({
+    promiseTypeSuffixes: ['REQUEST', 'SUCCESS', 'FAIL'],
+  })), window.devToolsExtension ? window.devToolsExtension() : f => f));
+};