Import
import { filterMap } from "@typed/fx/Push";Signatures
export declare const filterMap: {
<B, C>(f: (b: B) => Option.Option<C>): <A, E, R, E2, R2>(push: Push<A, E, R, B, E2, R2>) => Push<A, E, R, C, E2, R2>;
<A, E, R, B, E2, R2, C>(push: Push<A, E, R, B, E2, R2>, f: (b: B) => Option.Option<C>): Push<A, E, R, C, E2, R2>;
};Why
Combine output parsing and filtering without a sentinel value or a second pass.
Ownership and lifetime
The mapper is synchronous at upstream onSuccess invocation and resource-free.
The wrapped Fx retains ownership of subscription, Scope, interruption, and
finalizers.
Examples
import { Effect, Option } from "effect"
import * as Fx from "@typed/fx/Fx"
import * as Push from "@typed/fx/Push"
import * as Sink from "@typed/fx/Sink"
const push = Push.make(Sink.make(() => Effect.void, (_: string) => Effect.void), Fx.fromIterable(["1", "x"]))
const numbers = Push.filterMap(push, (text) => /^\d+$/.test(text) ? Option.some(Number(text)) : Option.none())Other public imports
These import paths expose the same declaration. Each page retains its own public name and signature.