@metreeca/flow - v0.9.21
    Preparing search index...

    Function merge

    • Creates a feed interleaving multiple feeds.

      All feeds are opened together and consumed concurrently, each kept one item ahead, so items are emitted as they become available rather than in argument order and a slow feed never holds back the others.

      Warning

      Output order is not preserved: items interleave and overtake each other according to how quickly every feed produces them.

      Type Parameters

      • V

        The type of values contributed to the feed

      Parameters

      • ...feeds: readonly Feed<V>[]

        The feeds to interleave

      Returns Feed<V>

      A feed yielding the items of all feeds as they become available

      await pipe(
      (merge(items(1, 2), items(3, 4)))
      (toArray())
      ); // [1, 3, 2, 4], depending on async timing

      feed to open a feed from a data source of any other shape