Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

single

import { single } from "https://raw.githubusercontent.com/surma/observables-with-streams/28c55be6d855780c677fd1f4ba975f4d3144891d/src/sinks/index.ts";

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

async function single<T>(o: Observable<T>): Promise<T>;
§
single<T>(o: Observable<T>): Promise<T>
[src]

§Type Parameters

§Parameters

§

Observable to extract from.

§Return Type

§
Promise<T>
[src]

Promise that resolves with a single item.