Total Complexity | 1 |
Complexity/F | 1 |
Lines of Code | 25 |
Function Count | 1 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 4 | ||
Bugs | 0 | Features | 0 |
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; |