Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const getIn = (state, path) => {
- if (!state) {
- return state
- }
- const length = path.length
- if (!length) {
- return undefined
- }
- let result = state
- for (let i = 0; i < length && !!result; ++i) {
- result = result[path[i]]
- }
- return result
- }
- const merge = (state,paylod) => ({...state, ...payload})
- getIn(state, ['router', 'location'])
Add Comment
Please, Sign In to add comment