Creates a sink retrieving the first item matching a predicate.
Items are tested in source order and consumption stops at the first match, leaving the rest of the feed unconsumed.
The type of items in the feed
The function testing each item
A sink resolving to the first item matching predicate, or to undefined if no item does
predicate
undefined
await pipe( (items(1, 2, 3, 4, 5)) (find(n => n > 3))); // 4 Copy
await pipe( (items(1, 2, 3, 4, 5)) (find(n => n > 3))); // 4
Creates a sink retrieving the first item matching a predicate.
Items are tested in source order and consumption stops at the first match, leaving the rest of the feed unconsumed.