kinetex - v1.0.0-rc.1
    Preparing search index...

    Interface HookOptions

    Registration options for lifecycle hooks — controls identity, ordering, execution constraints, and error isolation.

    interface HookOptions {
        id?: string;
        priority?: number;
        once?: boolean;
        condition?: (ctx: HookContext) => boolean;
        safe?: boolean;
    }
    Index

    Properties

    id?: string

    Unique hook ID. Auto-generated if omitted.

    priority?: number

    Execution priority (lower = runs first). Default: 0

    once?: boolean

    If true, auto-eject after first execution.

    condition?: (ctx: HookContext) => boolean

    Only run if this predicate returns true for the context.

    safe?: boolean

    If true, errors thrown by this hook are caught and logged rather than propagated.

    Use safe: true for hooks that should not break the pipeline if they fail (e.g., logging hooks, metrics hooks).

    Note: If ALL hooks have safe: true, errors will be silently swallowed. Use safe: false (default) for critical hooks that must propagate errors.

    false