Skip to content

Releases: sidecus/roth.js

Enable memoization for useBoundActions.

26 Aug 18:23
Compare
Choose a tag to compare

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

13 Jul 22:16
da1a63f
Compare
Choose a tag to compare
  • 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)

19 Jun 22:59
e134849
Compare
Choose a tag to compare