forked from resource-watch/resource-watch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
store.js
22 lines (19 loc) · 764 Bytes
/
store.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import { createStore, applyMiddleware, compose, combineReducers } from 'redux'
import thunk from 'redux-thunk'
import * as reducers from 'redactions';
// REDUCERS
const reducer = combineReducers({ ...reducers });
export const initStore = () => {
return createStore(
reducer,
compose(
/* The router middleware MUST be before thunk otherwise the URL changes
* inside a thunk function won't work properly */
applyMiddleware(thunk),
/* Redux dev tool, install chrome extension in
* https://chrome.google.com/webstore/detail/redux-devtools/lmhkpmbekcpmknklioeibfkpmmfibljd?hl=en */
typeof window === 'object' &&
typeof window.devToolsExtension !== 'undefined' ? window.devToolsExtension() : f => f
)
);
}