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

    Function is_hook_rejection

    • Normalize any legal hook return value to a single "did it reject?" boolean.

      Hooks in jssm may return any of the following to indicate success: true, undefined, or a complex result whose pass field is true. They may return any of the following to indicate rejection: false, or a complex result whose pass field is false. This helper collapses all of those shapes into one boolean so callers don't have to re-implement the matrix.

      is_hook_rejection(true);            // false (pass)
      is_hook_rejection(undefined); // false (pass)
      is_hook_rejection(false); // true (reject)
      is_hook_rejection({ pass: true }); // false (pass)
      is_hook_rejection({ pass: false }); // true (reject)

      Type Parameters

      • mDT

        The type of the machine data member; usually omitted.

      Parameters

      Returns boolean

      true if the hook rejected the transition; false if it passed.

      If hr is not a recognized hook result shape (for example, a number or a plain object without a pass field).