JSSM, a JavaScript state machine - the FSM for FSL
    Preparing search index...

    Type Alias HookContext<mDT>

    Context object passed to every HookHandler. data is the data payload as it stands before the transition, and next_data is the payload that will be committed if the transition is accepted — handlers may inspect or mutate the latter via a HookComplexResult return value.

    The remaining fields describe the transition the hook is firing on. They are optional because a handler is not obliged to care about them, but the transition path always supplies all of them; action is undefined when the transition was not driven by an action.

    type HookContext<mDT> = {
        action?: string;
        data: mDT;
        forced?: boolean;
        from?: string;
        next_data: mDT;
        to?: string;
        trans_type?: JssmArrowKind;
    }

    Type Parameters

    • mDT
    Index
    action?: string

    The action that drove the transition, or undefined if none did.

    data: mDT
    forced?: boolean

    Whether this transition came from force_transition rather than transition.

    from?: string

    The state being left.

    next_data: mDT
    to?: string

    The state being entered.

    trans_type?: JssmArrowKind

    Which arrow kind the traversed edge carries — legal, main, or forced.

    Populated only when a transition-kind hook is installed (a standard, main, or forced transition hook, or their post- equivalents). With no such hook registered there is nothing to switch on, so jssm skips resolving the edge's kind and this is undefined. Install hook_standard_transition (or a sibling) if a general handler needs to read it.