Typescript Fsa Reducers Versions Save

Fluent syntax for defining typesafe reducers on top of typescript-fsa.

v1.2.2

3 years ago
  • 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

5 years ago
  • 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

5 years ago

1.1.0

New Features

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

v1.0.0

5 years ago

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

6 years ago

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

6 years ago

New features

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

v0.4.3

6 years ago

Sourcemaps are now included.

v0.4.2

7 years ago

Bugfix

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

v0.4.0

7 years ago

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 https://github.com/dphilipson/typescript-fsa-reducers/issues/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.