Skip to content

Instantly share code, notes, and snippets.

@tkdn
Last active March 27, 2017 12:50
Show Gist options
  • Save tkdn/6d839b3b5fca1204d0b6b589d63aefdc to your computer and use it in GitHub Desktop.
Save tkdn/6d839b3b5fca1204d0b6b589d63aefdc to your computer and use it in GitHub Desktop.
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