Only emits elements from an Iterable that match the given Predicate.
Filter even numbers
const filterEven = filter(isEven);const iterable = [1,2,3,4];const filteredIterable = filterEven(iterable);console.log(filteredIterable); // [2,4]
distinct, findFirst and first for similar operations.
an Iterable that only emits values for which the Predicate returns true
true
the Iterable value type
the Predicate to match
Generated using TypeDoc
Only emits elements from an Iterable that match the given Predicate.
Example
Filter even numbers
See
distinct, findFirst and first for similar operations.
Returns
an Iterable that only emits values for which the Predicate returns
true