Total Complexity | 0 |
Complexity/F | 0 |
Lines of Code | 26 |
Function Count | 0 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | import { createStore, applyMiddleware, compose } from 'redux'; |
||
2 | import { combineReducers } from 'redux-immutable'; |
||
3 | import { fromJS } from 'immutable'; |
||
4 | |||
5 | import routes from '../routes'; |
||
6 | |||
7 | import { createRouter, History } from '../../../dist'; |
||
8 | |||
9 | const history = History.createBrowserHistory(); |
||
10 | |||
11 | const slice = 'router'; |
||
12 | const router = createRouter({ history, routes, slice, immutable: true }); |
||
13 | const middleware = [router.middleware]; |
||
14 | const toEnhance = [ |
||
15 | router.enhancer, |
||
16 | applyMiddleware(...middleware), |
||
17 | window && window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__() |
||
18 | ].filter(Boolean); |
||
19 | const enhancer = compose(...toEnhance); |
||
20 | const reducers = combineReducers({ |
||
21 | [slice]: router.reducer |
||
22 | }); |
||
23 | |||
24 | const store = createStore(reducers, fromJS({}), enhancer); |
||
25 | |||
26 | export default store; |