I am answering blindly here. Without having seen any code, the issue is probably that the modified state is not applied.
Remember, Immutable objects never change, mutations always result in a new object being returned. So if you forget to return/apply the returned object, your change is lost.
const reducer = createReducer(initialState, {
deleteSection: (state, { id }) => {
return state.deleteIn(['sections', 'Resources']);
},
deleteSectionToo: (state, { id }) => {
// Update can be used too, but it is mostly useful when you want to change something.
// e.g. add/remove an item in a sub-list.
return state.update('sections', (sectionsState) => {
return sectionsState.delete('Resources');
});
}
};
For more examples, consult the docs.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…