awesome-repositories.com
Blog
awesome-repositories.com

Découvrez les meilleurs dépôts open-source grâce à notre recherche par IA.

ExplorerRecherches sélectionnéesAlternatives open sourceLogiciels auto-hébergésBlogPlan du site
ProjetÀ proposNotre méthodologiePresseServeur MCP
Mentions légalesConfidentialitéConditions d'utilisation
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
jakesgordon avatar

jakesgordon/javascript-state-machine

0
View on GitHub↗
8,751 stars·946 forks·JavaScript·MIT·3 vues

Javascript State Machine

This library is a finite state machine framework for JavaScript designed to manage application states and valid transitions. It provides a system for executing state changes with lifecycle hooks, conditional guards, and transition cancellation.

The project is distinguished by its ability to inject state machine logic and transition capabilities directly into existing JavaScript class instances or objects. It also includes a visualization tool that exports state configurations into Graphviz DOT language for auditing system logic.

The framework covers asynchronous transition execution and pausing via promises, dynamic target state resolution, and state history tracking. It supports the creation of multiple independent machine instances from shared templates and provides mechanisms for attaching custom data and defining reusable methods.

Lifecycle management is handled through automatic callbacks triggered during the entry, exit, and observation phases of a transition.

Features

  • Finite State Machine Engines - Provides a general-purpose finite state machine engine for managing application states and valid transitions in JavaScript.
  • State-Transition Execution - Provides the core runtime logic to execute a change from one state to another after validating the transition.
  • Application State Management - Manages the current state of a JavaScript application and controls valid transitions for predictable behavior.
  • Lifecycle Hook Executions - Executes user-defined functions automatically before or after state transitions to handle side effects.
  • State Transition Lifecycle Hooks - Triggers callback functions automatically before and after state transitions to handle side effects and validation.
  • Asynchronous State Transition Orchestration - Handles state transitions that require asynchronous operations, promises, and lifecycle hooks.
  • State Logic Injection - Provides the ability to inject state machine capabilities and transition logic into existing JavaScript object instances.
  • Behavioral Logic Injection - Injects state machine logic and transition capabilities directly into existing JavaScript objects or class prototypes.
  • FSM Behavior Injectors - Attaches state machine logic and transition capabilities directly to existing JavaScript class instances.
  • Object Behavior Injection - Injects finite state machine capabilities into existing JavaScript objects or classes to control their operational modes.
  • Class-Based State Integration - Allows state machine functionality to be baked into class definitions so every instance manages its own state.
  • Dynamic State Resolution - Calculates the next target state at runtime using a function instead of a static destination name.
  • State Transition Event Triggers - Runs custom callbacks automatically upon entering or leaving specific states during the transition process.
  • Dynamic State Resolution - Allows the next target state to be determined dynamically at runtime via a function.
  • State Mapping - Implements a mechanism to map trigger names to destination states using static configuration objects.
  • State Transition Mapping - Maps trigger names to source and destination states to control the movement between different operational modes.
  • Asynchronous Transition Control - Implements runtime logic to control movement between states using events, no-op transitions, and wildcard triggers.
  • Conditional Transition Logic - Defines conditional movements between states using runtime arguments and validation logic to prevent illegal transitions.
  • Custom State Transition Hooks - Triggers observer methods automatically during state entry, exit, or transitions to perform necessary side effects.
  • Conditional Transition Guards - Evaluates custom conditions before allowing a state transition to ensure the change is valid for the context.
  • Asynchronous State Transition Frameworks - Provides a system for executing asynchronous state changes with lifecycle hooks, conditional guards, and transition cancellation.
  • State Transition Validation - Implements checks to determine if a requested state transition is valid based on the current state.
  • State Graph Export - Converts state configurations into DOT language to produce visual directed graphs of states and transitions.
  • Graphviz-Based Graph Renderers - Exports internal transition maps into Graphviz DOT language for visual representation of state flow.
  • State Logic Visualizers - Generates a visual map of states and transitions to audit system logic and communicate flow.
  • State Machine Instance Factories - Provides a mechanism to create multiple independent state machine instances based on a single shared template.
  • State Machine Templating - Generates reusable constructors that produce independent instances sharing the same state logic and configuration.
  • Transition Cancellations - Provides a mechanism to prevent state changes by returning false during lifecycle events.
  • State Machine Instance Factories - Provides a constructor-based factory to generate multiple independent state machine instances from a shared configuration.
  • State Activation Deferral - Allows state transitions to be paused by returning a promise that must resolve before entering the next state.

Historique des stars

Graphique de l'historique des stars pour jakesgordon/javascript-state-machineGraphique de l'historique des stars pour jakesgordon/javascript-state-machine

Recherche par IA

Explorez plus de dépôts awesome

Décrivez vos besoins en langage naturel — l'IA classe des milliers de projets open source sélectionnés par pertinence.

Start searching with AI

Alternatives open source à Javascript State Machine

Projets open source similaires, classés selon le nombre de fonctionnalités partagées avec Javascript State Machine.
  • pytransitions/transitionsAvatar de pytransitions

    pytransitions/transitions

    6,548Voir sur GitHub↗

    Transitions is an object-oriented finite state machine library for Python. It provides a framework for managing valid states and the logic for moving between them, including implementations for asynchronous state machines and thread-safe state managers. The library supports hierarchical state machines that allow states to be nested to organize complex subtasks and logical contexts. It includes tools for generating visual diagrams of states and transitions to document machine logic. The project covers state management primitives such as lifecycle callbacks, conditional transition guarding, an

    Python
    Voir sur GitHub↗6,548
  • dotnet-state-machine/statelessAvatar de dotnet-state-machine

    dotnet-state-machine/stateless

    6,191Voir sur GitHub↗

    Stateless is a .NET state machine library used to manage complex object behaviors and lightweight workflows through C# code. It functions as an asynchronous workflow engine that executes state transitions, guards, and entry-exit actions using asynchronous tasks. The library implements a hierarchical state machine, allowing child states to inherit transitions and properties from parent superstates. It includes a state persistence framework that decouples state tracking from machine logic by reading and writing the current state to external properties or databases. Additionally, it features a g

    C#
    Voir sur GitHub↗6,191
  • effector/effectorAvatar de effector

    effector/effector

    4,837Voir sur GitHub↗

    Effector is a reactive state management library designed for building complex, event-driven applications. It functions as a data flow engine that models application logic as a directed acyclic graph, ensuring that state updates propagate automatically through interconnected nodes. By utilizing atomic state updates and declarative unit composition, the library maintains data consistency and provides a predictable execution model for managing application state. The project distinguishes itself through its framework-agnostic architecture, which decouples business logic from user interface implem

    TypeScriptbusiness-logiceffectorevent-driven
    Voir sur GitHub↗4,837
  • aasm/aasmAvatar de aasm

    aasm/aasm

    5,219Voir sur GitHub↗

    This library provides a framework for defining finite state machines within Ruby classes to manage complex object lifecycles. It functions as a declarative workflow engine, allowing developers to model object states, events, and transitions through a readable domain-specific language. By integrating directly with database persistence layers, the framework ensures that state changes are synchronized with storage records while maintaining data integrity through transaction management and row locking. The library distinguishes itself by enforcing strict business rules through conditional transit

    Ruby
    Voir sur GitHub↗5,219
Voir les 30 alternatives à Javascript State Machine→

Questions fréquentes

Que fait jakesgordon/javascript-state-machine ?

This library is a finite state machine framework for JavaScript designed to manage application states and valid transitions. It provides a system for executing state changes with lifecycle hooks, conditional guards, and transition cancellation.

Quelles sont les fonctionnalités principales de jakesgordon/javascript-state-machine ?

Les fonctionnalités principales de jakesgordon/javascript-state-machine sont : Finite State Machine Engines, State-Transition Execution, Application State Management, Lifecycle Hook Executions, State Transition Lifecycle Hooks, Asynchronous State Transition Orchestration, State Logic Injection, Behavioral Logic Injection.

Quelles sont les alternatives open-source à jakesgordon/javascript-state-machine ?

Les alternatives open-source à jakesgordon/javascript-state-machine incluent : pytransitions/transitions — Transitions is an object-oriented finite state machine library for Python. It provides a framework for managing valid… dotnet-state-machine/stateless — Stateless is a .NET state machine library used to manage complex object behaviors and lightweight workflows through C#… effector/effector — Effector is a reactive state management library designed for building complex, event-driven applications. It functions… aasm/aasm — This library provides a framework for defining finite state machines within Ruby classes to manage complex object… pluginaweek/state_machine — This project is a Ruby library for defining and managing object lifecycles through states, events, and transition… zerobias/effector — Effector is a reactive state management library and data flow orchestrator designed for building complex, event-driven…