src/router.js   A
last analyzed

Complexity

Total Complexity 1
Complexity/F 1

Size

Lines of Code 25
Function Count 1

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 4
Bugs 0 Features 0
Metric Value
cc 0
wmc 1
c 4
b 0
f 0
nc 1
mnd 0
bc 1
fnc 1
dl 0
loc 25
rs 10
bpm 1
cpm 1
noi 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A router.js ➔ ??? 0 15 1
1
import enhancer from './store-enhancer';
2
import reducer from './reducer';
3
import middleware from './middleware';
4
5
import createLocationParser from './parsers/locationToState';
6
import createRouteParser from './parsers/routeToLocation';
7
import { DEFAULT_SLICE } from './constants';
8
9
const createRouter = ({
10
    history,
11
    routes,
12
    slice = DEFAULT_SLICE,
13
    immutable = false
14
}) => {
15
    const locationParser = createLocationParser(routes);
16
    const routeParser = createRouteParser(routes);
17
18
    return {
19
        reducer: reducer({ locationParser, immutable }),
20
        enhancer: enhancer({ history, slice, locationParser, immutable }),
21
        middleware: middleware({ history, routeParser })
22
    };
23
};
24
25
export default createRouter;