Skip to content

A fluent JavaScript State Machine (with TypeScript support)

Notifications You must be signed in to change notification settings

2Toad/fluent-state

Repository files navigation

Fluent State 🔄

GitHub Release Downloads Build status

A fluent JavaScript State Machine with full TypeScript support

Getting Started

Install package

npm i @2toad/fluent-state

Usage

import { fluentState } from '@2toad/fluent-state';
// or
const { fluentState } = require('@2toad/fluent-state');
fluentState
  .from('vegetable').to('diced').or('pickled')
  .from('diced').to('salad').or('trash');

fluentState
  .when('diced').do(() => console.log('diced'));

// Perform transition
await fluentState.transition('diced');
// or
await fluentState.next();

Further Reading

Core Concepts

Key Features

Debugging & Monitoring

Extension

  • Plugins - Extend functionality with plugins
  • Contributing - Guidelines for contributors
  • Roadmap - Upcoming features and improvements

Contributing 🤝

So you want to contribute to the Fluent State project? Fantastic! Please read the Contribute doc to get started.

About

A fluent JavaScript State Machine (with TypeScript support)

Resources

Stars

Watchers

Forks

Packages

No packages published