Skip to content

Latest commit

 

History

History
13 lines (8 loc) · 335 Bytes

readme.md

File metadata and controls

13 lines (8 loc) · 335 Bytes

dfr JSR

Creates a promise and returns it along with resolve and reject functions.

import dfr from "jsr:@korkje/dfr";

const { promise, resolve, reject } = dfr<string>();

setTimeout(() => resolve("hello"), 1000);

console.log(await promise); // "hello"