Releases: dphilipson/typescript-fsa-reducers
v1.2.2
- Types updated so passing
undefined
as the first argument to reducers produced byreducerWithoutInitialState
no longer typechecks (unlessundefined
is a subtype of their state). Thanks @sgrishchenko!
v1.2.0
- Added
.withHandling()
method for adding reusable sequences of updates in fluent style. - Adjusted
ReducerBuilder
type signature so the output type parameter is optional if it is the same as the input.
v1.1.0
1.1.0
New Features
- Added
.default()
method to apply a handler to unhandled actions (thanks to @monsterkrampe).
v1.0.0
1.0.0 is Here 🎉
The API of this library hasn't changed for some time, and it has seen extensive production use since the last release. The time has come to announce 1.0.0 and commit to stability.
Breaking changes
-
typescript-fsa
is now a peer dependency instead of a hard dependency. This will avoid situations where the dependency would be duplicated due to version differences but could cause you problems if you were relying ontypescript-fsa-reducers
to pull intypescript-fsa
for you. To resolve this, make sure to installtypescript-fsa
as a separate dependency:yarn add typescript-fsa
v0.4.5
Type definition of reducers created by builders now accepts undefined
as its first argument (the state), which causes the initial state to be used. This functionality was always present, but "hidden" by the type definition. This change matches an equivalent one in the Redux type definitions seen here.
Thanks to @amc6 for the contribution!
v0.4.4
New features
- Adds
.cases()
and.casesWithAction()
methods, allowing a handler to be assigned to multiple action types at once.
v0.4.3
Sourcemaps are now included.
v0.4.2
Bugfix
Reducers created using .build() can now be exported without dependencies on typescript-fsa.
v0.4.0
Breaking Change
Reducer chains are now mutable, meaning that reducer.case()
modifies the callee rather than returning a new instance. To produce immutable reducers, a new .build()
method is introduced. This is in line with a typical builder pattern.
For discussion on the change, see #7.
New features
.build()
method for producing an immutable reducer as a plain function..caseWithAction()
method for adding handlers which receive the whole action rather than just the payload.
Thanks very much to @autoric for the ideas behind this release.