shared
utils
string
object
is
extension
js
tracking
string
dom
when
selection
position
iframe
event
scroll
console
node
string
project
fs
console
forEachAsync
Type:Function
Status:stable
Platform:jsnode
@blackbyte.sugar.shared.array
Allow to make some async foreach on your arrays
Params
- array*-Array
The array to loop on
- asyncFn*-Function
The async function to call on each items
Example
import { forEachAsync } from '@blackbyte/sugar/array';
import { sleep } from '@blackbyte/sugar/function';
forEachAsync([0,1,2,3], async (item) => {
await sleep(50);
console.log(item);
});
// 0
// 1
// 2
// 3Author
- Olivier Bosselolivier.bossel@gmail.comhttps://blackbyte.space