0.2.0 • Published 6 years ago

@byungi/p-timeout v0.2.0

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

@byungi/p-timeout

Promise timeout after a specified time.

Example

import pTimeout, {TimeoutError} from '@byungi/p-timeout'

pTimeout(pDelay(1000), 500) // After 500ms, delay promise is timeout.
    .catch(err => {
        console.log(err.isTimeout) // => true
        console.log(err instanceof TimeoutError) // => true
    })

API

pTimeout(promise, ms)

Wrap promise to timeout if input promise takes longer than the specified time.

License

MIT

0.2.0

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago