Skip to content

v4.0

Compare
Choose a tag to compare
@Harvtronix Harvtronix released this 05 Feb 19:23
· 159 commits to main since this release

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 a dispatch function is now handled when invoking the useSubstate or useDispatch hooks.
  • useDispatch now creates/returns a memoized, curried function that is automatically linked to to the provided substate.
  • useSubstate now internally uses useDispatch 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