Skip to content

WinstonFassett/matchina

Repository files navigation

matchina

Lightweight state machines in TypeScript, powered by tagged unions and mapped types.

Features

  • State Machines:
    • Strongly-typed machines, states, events and api
    • states may have typed payloads, events may have typed parameters
    • Powerful and flexible transitions configuration with typed parameters and exit states
      • receive event with all parameters
      • transition by name OR use transition functions for full control
    • send and strongly typed event api accept typed event and payload args
  • Tagged Unions: powerful, elegant matchbox factories for states, events and effects
  • Async: use promise handler and promise machine for bulletproof async
  • Extensibility: composable setup, enhancers, hooks, lifecycle
  • Extras: effects, subscribe, when, reset
  • Integrations: React

Acknowledgements

Greatly inspired by:

License

Published under MIT License.