Skip to content

v0.0.4

Choose a tag to compare

@github-actions github-actions released this 28 Jun 15:02
· 35 commits to refs/heads/main since this release
Immutable release. Only release title and notes can be modified.
3c9e1b5

Breaking changes

  • assertNever is renamed never.
  • State values must be non-nullish. useState, Getter, Setter, and a custom integration's Config.useState now constrain their type to T extends {}.

New

  • onInvalidTransition is an option of initialize in every package. It's called with { from, to } when transition() asks for a transition that the state's definition doesn't allow.

Behavior change

  • A disallowed transition no longer throws. The state stays as it is, and onInvalidTransition is called if it's set. The types already reject a disallowed transition() call, so this only happens through a cast.

Compatibility

  • The build output targets ES2015 instead of ES5.

Docs: Invalid transitions