aweary / react-copy-write

✍️ Immutable state with a mutable API
MIT License
1.79k stars 54 forks source link

[react-copy-write] provide snapshot of state to mutate callback #31

Closed shengmin closed 6 years ago

shengmin commented 6 years ago

Sometimes we want to read the current state during mutation, and it's expensive to read from the draft Proxy object according to immer, thus providing the current state to the mutator callback