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

fromPromise

import { fromPromise } from "https://github.gh-proxy.cn/raw.githubusercontent.com/baetheus/fun/main/async_iterable.ts";

Create an AsyncIterable from a Promise that resolves to a single value.

@example
import { fromPromise } from "./async_iterable.ts";

const promise = Promise.resolve("Hello");
const asyncIter = fromPromise(promise);

for await (const value of asyncIter) {
  console.log(value); // "Hello"
}
function fromPromise<A>(ua: Promise<A>): AsyncIterable<A>;
§
fromPromise<A>(ua: Promise<A>): AsyncIterable<A>
[src]

§Type Parameters

§Parameters

§
ua: Promise<A>
[src]

§Return Type

§
AsyncIterable<A>
[src]