- Type fixes for handlers of actions with data type
void
- Fixed a bug where
mapStateToProps
andmapDispatchToProps
might returnnull
.
- BREAKING CHANGE: action listener parameters have been swapped, with the first now being
getSlice
and the second being the action data. - BREAKING CHANGE:
createApp
now returns aReact.FunctionComponent
instead ofJSX.Element
- BREAKING CHANGE:
createContainer
type signature updated to take three generics (props, dispatch, and ownProps) instead of a single argument (the old behavior was a bug) - BREAKING CHANGE:
createListener
has been renamed tohandle
- The old name implied that it behaved similarly to
createReducer
, when in fact it's actually similar tocreateReducer().handle()
- The old name implied that it behaved similarly to
- POSSIBLY BREAKING CHANGE:
createReducer
andhandle
(formerlycreateListener
) no longer throw after app creation- We already prevented reducers and listeners from being created and connected to an app after app creation due to how these are wired up to
createApp
- Throwing this exception could, in some circumstances, break apps where stores are destroyed and recreated, such as in Next.js apps
.handle
and similar methods on reducer/listener instances still throw
- We already prevented reducers and listeners from being created and connected to an app after app creation due to how these are wired up to
- Tightened up
createApp
type for component to beReact.Component
instead ofany
- If anything other than a
React.Component
instance was passed in, this would have crashed at runtime anyways, and so isn't really a breaking change
- If anything other than a
- Cleaned up generic names to be more readable
- Fixed a bug where container types aren't propagated to parent components properly
- Updated dependencies with breaking changes
- Added a better error message when prematurely calling dispatch
- Fixed a TypeScript "hole" where container's own properties weren't being passed out to parent components consuming the container
- Updated action listeners so they are passed
getSlice
as the second argument, just like containers
This is a major rewrite, with some fairly significant changes to the API.
- BREAKING CHANGE: renamed
createRoot
tocreateApp
and changed it's signature (see README for details) - BREAKING CHANGE: renamed
listen
tocreateListener
- BREAKING CHANGE: reworked
createListener
andcreateReducer
so they are not automatically attached, and instead return values that must be passed tocreateApp
- BREAKING CHANGE: Removed
reducer#isHandlerRegistered
andreducer#removeHandler
- BREAKING CHANGE: action listeners and reducer handlers must be registered before app creation
- Added support for passing in interfaces to strictly type actions and state slices
- Added support for own props in containers
- Published first release version