@szilanor/stream
    Preparing search index...

    Function flatMapAsync

    • Returns an AsyncOperationFunction that yields the inner entries of the result produced by the function.

      Type Parameters

      • T

        The type of the elements in the source Iterable.

      • O

        The type of the elements in the result Iterable.

      Parameters

      • mapper: (value: T, index: number) => Iterable<O>

        The function to use to map the entries.

      Returns AsyncOperationFunction<T, O>

      An AsyncOperationFunction that yields the inner entries of the result produced by the function.

      const result = flatMapAsync<number, number>([1, 2, 3], (value) => [value, value * 2]);
      console.log(result); // [1, 2, 2, 4, 3, 6]