UNPKG

@reactivex/ix-esnext-esm

Version:

The Interactive Extensions for JavaScript

12 lines (10 loc) 265 B
export async function first(source, predicate = async () => true) { let i = 0; for await (const item of source) { if (await predicate(item, i++)) { return item; } } return undefined; } //# sourceMappingURL=first.mjs.map