forked from Vizzuality/kenya-dashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstore.js
More file actions
24 lines (21 loc) · 751 Bytes
/
store.js
File metadata and controls
24 lines (21 loc) · 751 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import React from 'react';
import { createStore, combineReducers, applyMiddleware } from 'redux';
import { composeWithDevTools } from 'redux-devtools-extension';
import thunk from 'redux-thunk';
import * as reducers from 'modules';
const reducer = combineReducers({
...reducers
});
const initStore = (initialState = {}) =>
createStore(
reducer,
initialState,
/* Redux dev tool, install chrome extension in
* https://chrome.google.com/webstore/detail/redux-devtools/lmhkpmbekcpmknklioeibfkpmmfibljd?hl=en */
composeWithDevTools(
/* The router middleware MUST be before thunk otherwise the URL changes
* inside a thunk function won't work properly */
applyMiddleware(thunk)
)
);
export { initStore };