examples/src/store/index.js   A
last analyzed

Complexity

Total Complexity 0
Complexity/F 0

Size

Lines of Code 26
Function Count 0

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 0
wmc 0
c 2
b 0
f 0
nc 1
mnd 0
bc 0
fnc 0
dl 0
loc 26
rs 10
bpm 0
cpm 0
noi 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;