Skip to main content

Xstate

Recommendation
Updated
Moved
USE
2023-06-22

What is it

XState is an npm package that provides a finite state machine and statecharts for Typescript.

When to use it

Statecharts are a formalism for modeling stateful, reactive systems. This is useful for declaratively describing the behavior of your application, from the individual components to the overall application logic.

Use it when you have complex flows in your application and want to make sure that that the entity which is moving through your flow can be in exactly one of finite and well defined states at a time (e.g. an auth flow of a user).

How to learn it

  • Read the official docs