es7-sleep
Version:
ES7 sleep function with async/await
43 lines (29 loc) • 806 B
Markdown
[![NPM version][npm-image]][npm-url]
[![Build Status][travis-image]][travis-url]
[![Downloads][downloads-image]][downloads-url]
ES7 sleep function with async/await
```
npm install es7-sleep
```
```
import sleep from "es7-sleep";
async () => {
...
while(!result) {
await sleep(1000);
result = redis.get(key);
}
...
}
```
MIT
[]: https://img.shields.io/npm/v/es7-sleep.svg?style=flat-square
[]: https://npmjs.org/package/es7-sleep
[]: http://img.shields.io/npm/dm/es7-sleep.svg?style=flat-square
[]: https://npmjs.org/package/es7-sleep
[]: https://img.shields.io/travis/Secbone/es7-sleep.svg?style=flat-square
[]: https://travis-ci.org/Secbone/es7-sleep