Last active
March 27, 2017 12:50
-
-
Save tkdn/6d839b3b5fca1204d0b6b589d63aefdc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function prevLocation(state = { | |
refDomNode: null, | |
method: null | |
}, action) { | |
switch (action.type) { | |
case LOCATION_CHANGE: | |
const method = action.payload.action | |
return Object.assign({},state,{ | |
method: method | |
}) | |
case SET_PREVDOM: | |
const refdomObj = Object.assign({}, state.refDomNode, action.refDomNode) | |
return Object.assign({},state,{refDomNode:refdomObj}) | |
default: | |
return state | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment