Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/stream_observables/sinks/mod.ts>single

A collection of observables built with ReadableStreams & friends.
Latest
function single
import { single } from "https://deno.land/x/stream_observables@v1.3/sinks/mod.ts";

Resolves with the only element emitted by the observable. If zero or more than one items are emitted, the promise is rejected.

Parameters

Observable to extract from.

Returns

Promise<T>

Promise that resolves with a single item.