Skip to content

Releases: sidecus/roth.js

Enable memoization for useBoundActions.

Choose a tag to compare

@sidecus sidecus released this 26 Aug 18:23

Bound actions are called usually from within useEffect or event handlers. Without memoization, when using within useEffect it can trigger unwanted re-rendering if it's added into the dependency list.

To really benefit from memoization, the parameters (named action creators map) should be defined at global scope instead of function scope.
This is documented in the type definitions and readme.

switch to bindActionCreators and improve typing

Choose a tag to compare

@sidecus sidecus released this 13 Jul 22:16
da1a63f
  • switch to bindActionCreators for useBoundActions to further reduce package size and remove custom code.
  • improve ActionReducerMap typing for createSlicedReducer

2.0.3 release with (adding useBoundActions hook)

Choose a tag to compare

@sidecus sidecus released this 19 Jun 22:59
e134849