Skip to content

A simple timer app demo with xState machine for state management and generative integration tests.

Notifications You must be signed in to change notification settings

YevhenCodes/xstate-timer-demo

Repository files navigation

xState timer demo

Generative integration tests status

It's a simple timer app that uses xState to manage the state of the timer. It allows user to set the timer and displays the remaining time. The timer can be paused, resumed, continued and stopped.

State machine visualization

Why it's interesting

  • The whole state of the timer described and managed as a state machine.
  • It's a timed state machine. The remaining value update and ticking interval is implemented on top of the actor.
  • Timer has 1/10 of the second precision, which makes it more interesting to implement.
  • Timer is covered with generative integration tests. @xstate/graph is used to generate state machine paths, steps from which are transformed into test actions. Generative tests example

State machine visualization with Stately

State machine visualization

About

A simple timer app demo with xState machine for state management and generative integration tests.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published