@3xpo/resolvablepromise
TypeScript icon, indicating that this package has built-in type declarations

0.2.11 • Public • Published

@3xpo/resolvablepromise

Promises which can be resolved from their object

Example Usage

import ResovlablePromise from '@3xpo/resolvablepromise';
const p = new ResolvablePromise();
setTimeout(() => p.resolve('World'), 100);
const p2 = new ResolvablePromise();
setTimeout(() => p.resolve('How are you?'), 200);
(async () => {
  console.log('Hello,');
  console.log(`${await p}!`);
  await p2;
  console.log(p2.value);
})();

Dependencies (0)

    Dev Dependencies (7)

    Package Sidebar

    Install

    npm i @3xpo/resolvablepromise

    Weekly Downloads

    53

    Version

    0.2.11

    License

    MIT

    Unpacked Size

    27.2 kB

    Total Files

    11

    Last publish

    Collaborators

    • exponentialworkload