@thingts/fsm-engine - v1.2.1
    Preparing search index...

    Interface FsmGuardedTransitionBuilder<State, Events, Context, K>

    Builder used after one or more guards have been declared.

    Supports chaining additional guards and then declaring the guarded transition.

    interface FsmGuardedTransitionBuilder<
        State extends string,
        Events extends EventMap,
        Context,
        K extends EventName<Events>,
    > {
        stay(
            body?: (
                t: FsmTransitionActionsBuilder<State, Events, Context, K>,
            ) => void,
        ): void;
        toState(
            target: State,
            body?: (t: FsmTransitionActionsBuilder<State, Events, Context, K>) => void,
        ): void;
        when(cond: FsmGuard<State, Events, K, Context>): this;
    }

    Type Parameters

    Hierarchy

    Index

    Methods

    Methods

    • Adds another guard to the current guarded transition.

      Guards are evaluated in declaration order. All guards in the chain must pass for the transition to be selected.

      Parameters

      Returns this