Skip to content

Releases: evanshortiss/tstate-machine

Release list

2.0.1

Choose a tag to compare

@evanshortiss evanshortiss released this 03 Mar 22:40
  • Fix error where transitioning boolean was left true after state change had completed.

2.0.0

Choose a tag to compare

@evanshortiss evanshortiss released this 03 Mar 22:24
2482179
  • StateMachine constructor now expects an options Object, i.e super(opts).
  • opts.initialTransitions is required by the super constructor. This replaces $next requirement.
  • Rename IStateDeclaration to PartialProperties.
  • Remove support for individual class fields in favour of a props container.
  • opts.props is required by the super constructor. This replaces rememberInitState requirement.
  • Add Properties and ValidStates generics, i.e StateMachine<Properties, ValidStates>
  • Disable console.error logs by default. Can be enabled via opts.logging.
  • Make transitTo and others type safe using ValidStates generic.
  • Return typed errors from transitTo. These use the TransitionError type.
  • Change signature of onEnter callbacks to (prevState: string ...args: Array<any>) => void
  • Change signature of onLeave callbacks to (targetState: string) => void
  • Fix issue #1.