Creates a wrapper function for a Promise that allows for cancellation and clearing of queued Promises.

  • Type Parameters

    • T extends unknown = any

      The resolved value of the Promise.

    • P extends any[] = any[]

      The types of the arguments passed to the promise function.

    Parameters

    • promise: (...args: P) => Promise<T>

      The promise function to be wrapped.

    Returns IWrappedFn<T, P>

    • The wrapped function.