SAS logoSAS® Mobile Investigator API
    Preparing search index...

    Interface EventHook<T, R>

    A hook object with an execute property that contains a callback which returns a promise.

    interface EventHook<T = any, R = any> {
        exec: (payload: T) => Promise<void | R>;
        onFail?: (payload: T) => Promise<void | R>;
        order?: number;
    }

    Type Parameters

    • T = any
    • R = any
    Index

    Properties

    Properties

    exec: (payload: T) => Promise<void | R>

    The callback method called when the hook is triggered.

    Type Declaration

      • (payload: T): Promise<void | R>
      • Parameters

        • payload: T

          The data which the callback has access to.

        Returns Promise<void | R>

        A promise of type R or void.

    onFail?: (payload: T) => Promise<void | R>

    The callback method which runs if a preceding action has been aborted, or has failed.

    Type Declaration

      • (payload: T): Promise<void | R>
      • Parameters

        • payload: T

          The data which the callback has access to.

        Returns Promise<void | R>

        A promise of type R or void.

    order?: number

    An optional property which defines the order in which the hooks run. If no order is defined, a value of 0 is assigned. Hooks run in ascending order.