Total Complexity | 5 |
Complexity/F | 2.5 |
Lines of Code | 13 |
Function Count | 2 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | import { ACTION_TYPES } from './constants'; |
||
2 | |||
3 | export default ({ locationParser, immutable }) => (state = immutable ? require('immutable').fromJS({}) : {}, { type, payload }) => { |
||
4 | |||
5 | if (type === ACTION_TYPES.LOCATION_CHANGED) { |
||
6 | |||
7 | const result = locationParser(payload); |
||
8 | |||
9 | return immutable ? require('immutable').fromJS(result) : result; |
||
10 | } |
||
11 | |||
12 | return state; |
||
13 | }; |