Filter a stream based on a boolean function, only passing data that results in a true condition

filter_stream(fn, ...)

Arguments

fn

function applied to each chunk of stream that returns a boolean value

...

arguments passed to TransformStream

Examples

filterer <- as_reader(1:10) %|>%
    filter_stream(~ .x < 5L) |>
    on("data", print)