Skip to content

Releases: dphilipson/typescript-fsa-reducers

v1.2.2

10 Jul 17:45
Compare
Choose a tag to compare
  • Types updated so passing undefined as the first argument to reducers produced by reducerWithoutInitialState no longer typechecks (unless undefined is a subtype of their state). Thanks @sgrishchenko!

v1.2.0

09 Jan 19:52
Compare
Choose a tag to compare
  • 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

20 Nov 01:49
Compare
Choose a tag to compare

1.1.0

New Features

  • Added .default() method to apply a handler to unhandled actions (thanks to @monsterkrampe).

v1.0.0

05 Oct 23:42
Compare
Choose a tag to compare

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 on typescript-fsa-reducers to pull in typescript-fsa for you. To resolve this, make sure to install typescript-fsa as a separate dependency:

    yarn add typescript-fsa
    

v0.4.5

28 Nov 18:19
Compare
Choose a tag to compare

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

23 Jun 00:15
Compare
Choose a tag to compare

New features

  • Adds .cases() and .casesWithAction() methods, allowing a handler to be assigned to multiple action types at once.

v0.4.3

30 May 00:55
Compare
Choose a tag to compare

Sourcemaps are now included.

v0.4.2

02 May 00:58
Compare
Choose a tag to compare

Bugfix

Reducers created using .build() can now be exported without dependencies on typescript-fsa.

v0.4.0

01 May 21:14
Compare
Choose a tag to compare

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.