@alexsergey/async-loop

Async loop and inverse async loop

Usage no npm install needed!

<script type="module">
  import alexsergeyAsyncLoop from 'https://cdn.skypack.dev/@alexsergey/async-loop';
</script>

README

Async Loop

Async loop and inverse async loop

import { asyncLoop, inverseAsyncLoop } from '@alexsergey/async-loop';

asyncLoop(items, (item, loop) => {
    //.. async logic
    loop.iteration() // return index of array iteration
    loop.next() // next iteration
    loop.break() // cancel loop
}, () => {
    // it calls after all iterations
})