Creates a task retaining only the items matching a predicate.
Items are tested lazily, one at a time, and emitted in source order.
The type of items in the feed
The function testing each item; an undefined result is treated as false and the item is discarded
undefined
false
A task yielding the items matching predicate
predicate
await pipe( (items(1, 2, 3, 4, 5)) (filter(n => n%2 === 0)) (toArray())); // [2, 4] Copy
await pipe( (items(1, 2, 3, 4, 5)) (filter(n => n%2 === 0)) (toArray())); // [2, 4]
Creates a task retaining only the items matching a predicate.
Items are tested lazily, one at a time, and emitted in source order.