🏃‍♂️ Skips the first N elements of an async iterable.

Syntax

TypeScript
import { dropIterAsync } from '@opentf/std';

dropIterAsync<T>(iterable: AsyncIterable<T>, n: number): AsyncGenerator<T>

Parameters

  • iterable: The source async iterable.

  • n: The number of items to skip.

Returns

A new async generator with the remaining items.

Examples

TypeScript
async function* gen() { yield 1; yield 2; yield 3; }
await toArrayIterAsync(dropIterAsync(gen(), 1)) //=> [2, 3]
Last updated on
Edit this page