Import
import { Sink } from "@typed/fx";Access Sink.collect 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 function collect<A, E>(ref: Ref.Ref<ReadonlyArray<A>>): Sink<A, E, never>;Why
Collection remains an explicit consumer concern and the accumulated result can be read without changing the producer.
Ownership and lifetime
The caller owns the Ref. Each success returns a lazy atomic Ref.update that allocates a new array.
Serialized producers collect in callback-Effect execution order. Concurrent updates remain atomic,
but execution scheduling—not invocation order—determines array order. Failures are ignored.
Examples
import { Effect, Ref } from "effect"
import * as Sink from "@typed/fx/Sink"
const program = Effect.gen(function* () {
const values = yield* Ref.make<ReadonlyArray<number>>([])
return Sink.collect(values)
})Other public imports
These import paths expose the same declaration. Each page retains its own public name and signature.