Useful for completely replacing the state when it makes more sense than modifying the current state. Acts as a sort of escape hatch for when more traditional reducer logic, including the use of higher-order array functions, is desired.
I just upgraded to immer@2.0.0 which changes the implementation a little bit. I'd be happy to take a new PR which takes that into account! Feel free to open a new PR or reopen this one when ready.
Useful for completely replacing the state when it makes more sense than modifying the current state. Acts as a sort of escape hatch for when more traditional reducer logic, including the use of higher-order array functions, is desired.
e.g.