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

    Function skip

    • Creates a task discarding a prefix of the feed.

      The leading items are drawn and dropped, then the rest of the feed is emitted in source order; a shorter feed is consumed entirely and nothing is emitted.

      Note

      • Incremental: items are emitted as they are drawn, so the reported feed runs dry as the feed drawn from does.
      • Streaming: items are emitted one at a time, none retained.
      • Stateful: the items already discarded decide the ones that follow, so a task invoked per nested feed or per run discards a prefix of each rather than of the feed as a whole.

      Type Parameters

      • V

        The type of items in the feed

      Parameters

      • n: number

        The number of leading items to discard; values less than 1 leave the feed untouched

      Returns Task<V>

      A task yielding the items following the first n

      TypeError If n is not an integer

      await pipe(
      (items([1, 2, 3, 4, 5]))
      (skip(2))
      (toArray())
      ); // [3, 4, 5]