using spread operator with state return.

This commit is contained in:
Nouman Tahir 2021-10-11 16:47:36 +05:00
parent 97a7b2c3a5
commit 61245bb54c

View File

@ -21,10 +21,14 @@ const initialState:State = {
switch (type) {
case SET_BENEFICIARIES:
state.beneficiariesMap[payload.draftId] = payload.benficiaries;
return state;
return {
...state //spread operator in requried here, otherwise persist do not register change
};
case REMOVE_BENEFICIARIES:
delete state.beneficiariesMap[payload.draftId]
return state;
return {
...state //spread operator in requried here, otherwise persist do not register change
};
default:
return state;
}