Import
import { Push } from "@typed/fx";Access Push.mapBoth 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 mapBoth: {
<B, C, E2, E3>(options: {
readonly onFailure: (e: E2) => E3;
readonly onSuccess: (b: B) => C;
}): <A, E, R, R2>(push: Push<A, E, R, B, E2, R2>) => Push<A, E, R, C, E3, R2>;
<A, E, R, B, E2, R2, C, E3>(push: Push<A, E, R, B, E2, R2>, options: {
readonly onFailure: (e: E2) => E3;
readonly onSuccess: (b: B) => C;
}): Push<A, E, R, C, E3, R2>;
};Why
Adapt both observable result channels at once while leaving command handling and non-typed Cause information intact.
Ownership and lifetime
Both functions run synchronously in the output delivery path and acquire no resources. The wrapped Fx retains ownership of its subscription and finalizers.
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 push = Push.make(Sink.make(() => Effect.void, (_: string) => Effect.void), Fx.succeed(2))
const labeled = Push.mapBoth(push, {
onFailure: (error: never) => error,
onSuccess: (value) => `value:${value}`
})Other public imports
These import paths expose the same declaration. Each page retains its own public name and signature.