Import
import { Push } from "@typed/fx";Access Push.filterInput 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 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.