import { concreteSink, SinkInternal } from "@effect/core/stream/Sink/operations/_internal/SinkInternal" /** * Accesses the environment of the sink in the context of a sink. * * @tsplus static effect/core/stream/Sink.Ops environmentWithSink */ export function environmentWithSink( f: (env: Env) => Sink ): Sink { return new SinkInternal( Channel.unwrap( Effect.environmentWith((r: Env) => { const sink = f(r) concreteSink(sink) return sink.channel }) ) ) }