effect-io-ai

Package: effect
Module: Channel

Channel.runLast

Runs a channel to completion and returns the last output element in an Option.

Details

Returns Option.some with the last emitted element, or Option.none if the channel completes without emitting output.

Signature

declare const runLast: <OutElem, OutErr, OutDone, Env>(self: Channel<OutElem, OutErr, OutDone, unknown, unknown, unknown, Env>) => Effect.Effect<Option.Option<OutElem>, OutErr, Env>

Source

Since v4.0.0