0.0.4 • Published 4 years ago

timeoutable-promise v0.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

timeoutable-promise

a timeoutable promise implement

promise is a async task, we do not know when it finished, sometimes we want it oly execute in a time window, add a timeout is needed.

how to use

if it is timeout. will throw a TimeoutError

new Promise((resolve, reject) => {
    reslove()
}, 500) // <-- here is a timeout

or use it as normal promise

new Promise((resolve, reject) => {
    reslove()
}) 
0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago