handleActions({ [CHANGE_INPUT]: (state, action) => state.set('input', action.payload), [INSERT]: (state, {payload: {id, text}}) => { const item = TodoRecord({id: id++, text}); return state.update('todos', todos => todos.push(item)); }, [TOGGLE]: (state, {payload: id}) => { const index = state.get('todos').findIndex(item => item.get('id') === id); return state.updateIn(['todos', index, 'checked'], checked => !checked); }, [REMOVE]: (state, {payload: id}) => { const index = state.get('todos').findIndex(item => item.get('id') === id); return state.deleteIn(['todos', index]); } }, initialState)
return state.withMutations(map => { map.setIn([ 'values', action.id ],action.value) .deleteIn([ 'errors', action.id ]) }) case types.SENDING_LOGIN:
.deleteIn([ 'todos', state.get('todos').findIndex(t => t.id === action.payload),