ES6
return {
...state,
[name]: value
}
SI
return state.merge({
[name]: value
})
ES6
return state.map(todo =>
todo.id === action.id ? {
...todo,
text: action.text
} :
todo
)
SI
return state.map(todo =>
todo.id === action.id ?
todo.merge({text: action.text}) :
todo
)