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

x/stream_observables/sources/from-promise.ts>fromPromise

A collection of observables built with ReadableStreams & friends.
Latest
function fromPromise
import { fromPromise } from "https://deno.land/x/stream_observables@v1.3/sources/from-promise.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

New observable that emits the value the promise settles with.