1.3.1 • Published 1 year ago

foreachthen v1.3.1

Weekly downloads
6
License
MIT
Repository
-
Last release
1 year ago

#For Each Then

License

The License information is avaliable in license.txt

##Summary This module provide a function on arrays called forEachThen. it allows you to specify a method that must be run after the for loop has completed/

var array = [ "list","of","stuff" ];
array.forEachThen(function(callback, item, idx)  {
  console.log("This method is run for each item in the array. Callback must be called in this function");
  callback();
},
function () {
  console.log("This method runs after all items have been processed");
} );
var array = [ "list","of","stuff" ];
array.forEachThenSeries(function(callback, item, idx)  {
  console.log("This method is run for each item in the array in a sequential order. Callback must be called in this function");
  callback();
},
function () {
  console.log("This method runs after all items have been processed");
} );
var fet = require('foreachthen');
var object = { "key" : "value" }

fet.ObjectforEach(object,function(key, value, idx)  {
  console.log("This will return keys and values as it goes over the object");
  console.log(key);
  console.log(value);
  console.log(idx);
  callback();
});
var fet = require('foreachthen');
var object = { "key" : "value" }

fet.ObjectforEachThen(object,function(callback, item, idx)  {
  console.log("This method is run for each item in the array. Callback must be called in this function");
  callback();
},
function () {
  console.log("This method runs after all items have been processed");
} );
var fet = require('foreachthen');
var object = { "key" : "value" }

fet.ObjectforEachThenSeries(object,function(callback, item, idx)  {
  console.log("This method is run for each item in the array in a sequential order. Callback must be called in this function");
  callback();
},
function () {
  console.log("This method runs after all items have been processed");
} );
1.3.1

1 year ago

1.3.0

6 years ago

1.2.1

7 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago