Import
import { filterInput } from "@typed/fx/Push";Signatures
export declare const filterInput: {
<A>(f: (a: A) => boolean): <E, R, B, E2, R2>(push: Push<A, E, R, B, E2, R2>) => Push<A, E, R, B, E2, R2>;
<A, E, R, B, E2, R2>(push: Push<A, E, R, B, E2, R2>, f: (a: A) => boolean): Push<A, E, R, B, E2, R2>;
};Why
Filtering before the consumer avoids teaching the underlying Sink about input values that are irrelevant to it.
Ownership and lifetime
The predicate is synchronous at onSuccess invocation and acquires no
resources. Accepted callback Effects retain the original Sink’s errors,
services, interruption, and cleanup.
Examples
import { Effect } from "effect"
import * as Fx from "@typed/fx/Fx"
import * as Push from "@typed/fx/Push"
import * as Sink from "@typed/fx/Sink"
const checks: Array<number> = []
const positives = Push.filterInput(
Push.make(Sink.make(() => Effect.void, (n: number) => Effect.log(n)), Fx.empty),
(n) => (checks.push(n), n > 0)
)
const acknowledgement = positives.onSuccess(-1)
// checks is already [-1]; acknowledgement performs no Sink callback.Other public imports
These import paths expose the same declaration. Each page retains its own public name and signature.