Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/stream_observables/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/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.