@anio-js-foundation/create-promise

2.0.0 • Public • Published

@anio-js-foundation/create-promise

Create a Promise whose resolve and reject functions are accessible from outside the Promise constructor.

import createPromise from "@anio-js-foundation/create-promise"

const {promise, resolve, reject} = createPromise()

// resolves "promise" after 1000ms
setTimeout(resolve, 1000, "abcdef")

console.log(await promise)

Readme

Keywords

none

Package Sidebar

Install

npm i @anio-js-foundation/create-promise

Weekly Downloads

0

Version

2.0.0

License

MIT

Unpacked Size

1.19 kB

Total Files

3

Last publish

Collaborators

  • exory2024
  • dasdeo