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

    Interface HookableEvent<T>

    interface HookableEvent<T> {
        addPostHook(hook: PostEventHook<T>): EventHookRemove;
        addPreHook(hook: PreEventHook<T>): EventHookRemove;
        trigger<R>(payload: T, action: () => Promise<R>): Promise<R>;
    }

    Type Parameters

    • T
    Index

    Methods

    • Runs all hooks of a specific event of the given event type.

      Type Parameters

      • R

      Parameters

      • payload: T

        The data which the callback of each hook has access to.

      • action: () => Promise<R>

        The action to perform.

      Returns Promise<R>

      A promise of type R.