Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/oguzhanumutlu/async-loop-js

Async Loops for JavaScript
https://github.com/oguzhanumutlu/async-loop-js

async helper javascript loop node web

Last synced: 27 days ago
JSON representation

Async Loops for JavaScript

Awesome Lists containing this project

README

        

# async-loop-js
Async Loops for JavaScript

# Examples

### `.startWhile()` example

```js
await AsyncLoop.startWhile({
statement: i => i < 10,
callback: i => console.log(`Iterating while for ${i}. time.`),
endCallback: i => console.log(`Iteration for while has ended at ${i}. iteration`),
ms: 20 // will repeat every 20ms
});
```

### `.repeat()` example

```js
await AsyncLoop.repeat({
iterations: 10,
callback: i => console.log(`Iterating repeat for ${i}. time.`),
endCallback: i => console.log(`Iteration for repeat has ended at ${i}. iteration`),
ms: 20 // will repeat every 20ms
});
```