Import
import { Push } from "@typed/fx";Access Push.map 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 map: {
<B, C>(f: (b: B) => 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) => C): Push<A, E, R, C, E2, R2>;
};Why
Adapt observed events without changing the commands the bidirectional boundary accepts.
Ownership and lifetime
f runs in the upstream Fx delivery path and owns no resource. Output
subscription, interruption, failures, services, and cleanup remain those of the
wrapped Fx and downstream Sink.
Examples
import { Effect } from "effect"
import * as Push from "@typed/fx/Push"
import { Fx } from "@typed/fx"
import * as Sink from "@typed/fx/Sink"
const program = Effect.gen(function* () {
const push = Push.make(
Sink.make(
(cause) => Effect.void,
(value) => Effect.void
),
Fx.succeed(42)
)
// Map output from number to string
const mapped = Push.map(push, (n) => `Number: ${n}`)
// Observe the mapped output
yield* Fx.observe(mapped, (value) =>
Effect.sync(() => console.log(value))
)
// Output: "Number: 42"
})Other public imports
These import paths expose the same declaration. Each page retains its own public name and signature.