Skip to content

Instantly share code, notes, and snippets.

@SiestaMadokaist
Last active December 2, 2016 00:58
Show Gist options
  • Save SiestaMadokaist/e7c2e0797c601bea63f6c0f5b5914690 to your computer and use it in GitHub Desktop.
Save SiestaMadokaist/e7c2e0797c601bea63f6c0f5b5914690 to your computer and use it in GitHub Desktop.
todo-reducer
import Immutable from 'immutable'
import { Actions } from 'actions'
const defaultState = new Immutable.List();
function reducer(state = defaultState, action){
if(action.type === Actions.STATE_REPLACE){
...
return replacedState;
}else if(action.type === Actions.REMOVE_STATE){
...
return removedState;
}
}
export default reducers;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment