@alextheman/utility - v5.34.0
    Preparing search index...

    Function memoizeAsync

    • Memoizes the Promise returned by an asynchronous callback.

      Note that the callback is invoked at most once. Arguments supplied to subsequent calls are ignored because the Promise from the first invocation is always returned.

      Type Parameters

      • ArgsType extends readonly unknown[]

        The type of the function arguments.

      • ResolvedType

        The type of the Promise when resolved.

      Parameters

      Returns Callback<ArgsType, ResolvedType>

      A callback with the Promise memoized. Multiple calls of this function should always point to the same Promise.