@chickenjdk/byteutils
    Preparing search index...

    Function maybeAsyncCallArr

    • Wrap a value for running a function multiple times with a different set of params each time. The function is ran with the params serially (one at a time, in order). If any of the values returned are async, this function will return a promise that resolves with all of the values returned after the promise-like values are resolved. Otherwise, it with synchronously return all of the values returned.

      Type Parameters

      • args extends unknown[]
      • ret

      Parameters

      • maybeAsyncFunc: (...args: args) => ret

        A function that may or may not return a promise

      • params: args[]

        The array of parameters to call the function with

      Returns ret extends PromiseLike<unknown> ? Promise<AwaitedUnion<ret>[]> : ret[]

      The results of the calls, either as an array of values or a promise that resolves to an array of values. See main description.