A fluent JavaScript State Machine with full TypeScript support
Install package
npm i @2toad/fluent-state
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();
- API Reference - Complete API documentation
- State Machine Architecture - Learn about Fluent State's non-hierarchical state machine design
- Auto-Transitions - Automatic state transitions based on conditions
- Batch Updates - Optimize performance with batched context changes
- Transition Groups - Organize and manage transitions collectively
- State Manager - Performance optimizations for state management
- Debugging Support - General debugging features
- Logging and Monitoring - Track state machine behavior
- Transition History - Record and analyze state transitions
- Time Travel Debugging - Step through historical states
- State Machine Visualization - Generate visual diagrams
- Plugins - Extend functionality with plugins
- Contributing - Guidelines for contributors
- Roadmap - Upcoming features and improvements
So you want to contribute to the Fluent State project? Fantastic! Please read the Contribute doc to get started.