Consider if the store-edit package should re-export Immutable and maybe castDraft from immer.
These symbols are already available as part of the packaged immer, and can be made available without downstream projects needing to explicitly depend and import their own version of immer which might create more problems than it's worth.
It's a good idea to use immer's Immutable modifier, but in practice, where some next state is partly based on an older state you read as an Immutable value, if your state is Immutable then you will need the castDraft() function to make it suitable for use within an editor callback.
Consider if the
store-editpackage should re-exportImmutableand maybecastDraftfromimmer.These symbols are already available as part of the packaged immer, and can be made available without downstream projects needing to explicitly depend and import their own version of
immerwhich might create more problems than it's worth.It's a good idea to use immer's
Immutablemodifier, but in practice, where some next state is partly based on an older state you read as an Immutable value, if your state isImmutablethen you will need thecastDraft()function to make it suitable for use within an editor callback.