Import
import { Sink } from "@typed/fx";Access Sink.slice through the imported Sink 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 slice: {
<A, E, R, R2>(bounds: Bounds, f: (sink: Sink<A, E, R>) => Effect.Effect<unknown, never, R2>): (sink: Sink<A, E, R>) => Effect.Effect<void, never, R | R2>;
<A, E, R, R2>(sink: Sink<A, E, R>, bounds: Bounds, f: (sink: Sink<A, E, R>) => Effect.Effect<unknown, never, R2>): Effect.Effect<void, never, R | R2>;
};Why
Consumers can skip an initial prefix and stop after a fixed number of values, allowing the surrounding producer work to finish early.
Ownership and lifetime
Each execution owns fresh counters and an early-exit callback. Successes remain ordered; at most
take values are delivered after skip values. Failures always pass through. Reaching the bound
completes and aborts the callback fiber; negative bounds are not normalized.
Examples
import { Effect } from "effect"
import * as Sink from "@typed/fx/Sink"
const target = Sink.make(Effect.logError, Effect.log)
const program = Sink.slice(target, { skip: 1, take: 2 }, (bounded) => bounded.onSuccess("kept"))Other public imports
These import paths expose the same declaration. Each page retains its own public name and signature.