1.0.5 • Published 7 years ago

foreach-then v1.0.5

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

Build Status

FOREACH-THEN

It's a shortcut , clean-code version of forEach in Javascript with ASYNC .

Why?

I did it for clean-code , only for this. We don't need to check if the iterate-function finishes and invoke the callback .

Installation

Yarn :

yarn add foreach-then

Npm :

npm i foreach-then --save

Example

const each = require('foreach-then');
var numeri = [1,2,3];

each(numeri,(element,index,collection,cb)=>
{   
    //iterate function    
    console.log(collection[index]);
    cb();  
},
(array)=>{
    //then function
    console.log("then")
    console.log(array);
});

Contribution

If you make a pull-request I'll give you a beer.

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.0

7 years ago