Import
import { Push } from "@typed/fx";Access Push.filterMapInput through the imported Push export. Its declaration below describes the member.
This public exposure is a re-export. Its import path is supported; declaration documentation is shared with the other public exposures below.
Signatures
export declare const filterMapInput: {
<C, A>(f: (c: C) => Option.Option<A>): <P extends Push.Any>(push: P) => Push<C, Sink.Error<P>, Sink.Services<P>, Fx.Fx.Success<P>, Fx.Fx.Error<P>, Fx.Fx.Services<P>>;
<A, E, R, B, E2, R2, C>(push: Push<A, E, R, B, E2, R2>, f: (c: C) => Option.Option<A>): Push<C, E, R, B, E2, R2>;
};Why
Option combines parsing and filtering without a sentinel value or a separate
predicate pass.
Ownership and lifetime
The mapping is synchronous at onSuccess invocation and resource-free. A
forwarded callback Effect retains the original Sink’s lifetime, error channel,
and service requirements.
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 parsed: Array<string> = []
const integers = Push.filterMapInput(
Push.make(Sink.make(() => Effect.void, (n: number) => Effect.log(n)), Fx.empty),
(text: string) => {
parsed.push(text)
return /^\d+$/.test(text) ? Option.some(Number(text)) : Option.none()
}
)
const acknowledgement = integers.onSuccess("nope")
// parsed is already ["nope"]; acknowledgement performs no Sink callback.Other public imports
These import paths expose the same declaration. Each page retains its own public name and signature.