Skip to content

A fluent JavaScript State Machine (with TypeScript support)

Notifications You must be signed in to change notification settings

2Toad/fluent-state

Folders and files

NameName
Last commit message
Last commit date

Latest commit

536f61f · Apr 21, 2025
Apr 21, 2025
Sep 10, 2024
Apr 21, 2025
Apr 21, 2025
Apr 21, 2025
May 29, 2022
Sep 10, 2024
Apr 21, 2025
Apr 21, 2025
Apr 21, 2025
Apr 21, 2025
Apr 21, 2025
May 30, 2022
Nov 25, 2019
Apr 20, 2025
Apr 21, 2025
Apr 21, 2025
Sep 10, 2024

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.