3.0.0 • Published 6 months ago
@2toad/fluent-state v3.0.0
Fluent State 🔄
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
- API Reference - Complete API documentation
- State Machine Architecture - Learn about Fluent State's non-hierarchical state machine design
Key Features
- 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 & Monitoring
- 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
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.