Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/rimbu/stream/async/async-transformer.ts>AsyncTransformer.filter

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
variable AsyncTransformer.filter
import { AsyncTransformer } from "https://deno.land/x/rimbu@1.2.1/stream/async/async-transformer.ts";
const { filter } = AsyncTransformer;

Returns an async transformer that filters elements from the input stream based on the provided predicate function.

type

{ <T, TF extends T>(pred: (
value: T,
index: number,
halt: () => void,
) => value is TF
, options?: { negate?: false | undefined; }
): AsyncTransformer<TF>; <T, TF extends T>(pred: (
value: T,
index: number,
halt: () => void,
) => value is TF
, options: { negate: true; }
): AsyncTransformer<Exclude<T, TF>>; <T>(pred: (
value: T,
index: number,
halt: () => void,
) => MaybePromise<boolean>
, options?: { negate?: boolean | undefined; }
): AsyncTransformer<T>; }