Creates a sink retrieving the first item that satisfies the predicate.
The type of items in the stream
The function to test each item
A sink that retrieves the first matching item or undefined
await items([1, 2, 3, 4, 5])(find(x => x > 3)); // 4await items([1, 2, 3])(find(x => x > 5)); // undefined Copy
await items([1, 2, 3, 4, 5])(find(x => x > 3)); // 4await items([1, 2, 3])(find(x => x > 5)); // undefined
Creates a sink retrieving the first item that satisfies the predicate.