Interface AsyncFuncRef<T>

Interface for an asynchronous function reference. Provides methods to call, get, set, and inject code before or after the stored async function.

interface AsyncFuncRef<T> {
    append(fn: () => void | Promise<void>): void;
    call(): Promise<T>;
    get(): () => Promise<T>;
    prepend(fn: () => void | Promise<void>): void;
    set(fn: () => Promise<T>): void;
}

Type Parameters

  • T

Methods

  • Appends a function to be executed after the stored async function.

    Parameters

    • fn: () => void | Promise<void>

      The function to run after the original async function.

    Returns void

  • Prepends a function to be executed before the stored async function.

    Parameters

    • fn: () => void | Promise<void>

      The function to run before the original async function.

    Returns void