function todos( state = initialState, {type, payload} ) { switch( type ) { case ADD_TODO_SUCCESS: return Object.assign({}, state, { data: [...state.data, payload] }); }