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

0.2.10 • 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);
})();

Readme

Keywords

none

Package Sidebar

Install

npm i @3xpo/resolvablepromise

Weekly Downloads

59

Version

0.2.10

License

MIT

Unpacked Size

27.2 kB

Total Files

11

Last publish

Collaborators

  • exponentialworkload