bcherny / undux

⚡️ Dead simple state for React. Now with Hooks support.
https://undux.org
MIT License
1.49k stars 31 forks source link

Functional updater form for store.set() #103

Open jackwlee01 opened 4 years ago

jackwlee01 commented 4 years ago

store.set() should support the functional form, as per https://reactjs.org/docs/hooks-reference.html#functional-updates, in order update the state based on an instruction, instead of the current value (which may be out of date in an async scenario).