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

x/stream_observables/mod.ts>fromAsyncFunction

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

Creates an observable from an asynchronous function. The observable emits exactly one value when once the function returns.

Parameters

f: () => Promise<T>

Async function that will be awaited.

Returns

New observable that emits the value the async function returns.