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

x/stream_observables/mod.ts>fromPromise

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

Creates an observable from a promise, that emits exactly one value when the promise resolves.

Parameters

p: Promise<T>

Promise that will be awaited.

Returns

Observable<T>

New observable that emits the value the promise settles with.