Cleaner/shorter way to update nested state in Redux?

UPD: it’s now a part of the ES2018

It might be slightly improved via a non-standardised yet properties spread syntax:

return {
    ...state,
    notificationBar: {
        ...state.notificationBar,
        open: true,
    },
};

Leave a Comment