v4.0
Quality of Life API Updates!
The 4.0 release includes breaking changes, but should improve the user experience when using the module. It should also be a tiny bit faster because of some clever memoization.
Changes
- Reworked
createAction
to not take a substate key as input. The mapping between a substate and adispatch
function is now handled when invoking theuseSubstate
oruseDispatch
hooks. useDispatch
now creates/returns a memoized, curried function that is automatically linked to to the provided substate.useSubstate
now internally usesuseDispatch
to obtain the dispatch function. This means less overall code and more efficiency.- Added some better debug logging.
- Unregistering patch effects is now done more reliably by maintaining the same array reference across invocations.
- All module exports are now exposed to consumers through both the default export and named exports.
- Removed terser from the rollup build. Consumers can minify their code and dependencies themselves, if desired. This makes development debugging a lot easier.
- Updated node modules.
Peer Dependency Updates
The Immer peer dependency has moved to v8.0 from v7.0