Skip to content

Loading…

Read element other than Array #181

Closed
wants to merge 1 commit into from

2 participants

@ShankarKamble

Add New method 'element' to async to read element other than Array

@ShankarKamble ShankarKamble Read element other than Array
Add New method 'element' to async to read element other than Array
e791851
@caolan
Owner

Duplicate

@caolan caolan closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 28, 2012
  1. @ShankarKamble

    Read element other than Array

    ShankarKamble committed
    Add New method 'element' to async to read element other than Array
Showing with 19 additions and 0 deletions.
  1. +19 −0 lib/async.js
View
19 lib/async.js
@@ -98,6 +98,25 @@
});
};
+// Modified
+// for read element
+async.element = function (element, iterator, callback) {
+ callback = callback || function () {};
+ if (element==null || element=='') {
+ return callback();
+ }
+ iterator(element, function (err) {
+ if (err) {
+ callback(err);
+ callback = function () {};
+ }
+ else {
+ callback(null);
+ }
+ });
+ };
+// Modified
+
async.forEachSeries = function (arr, iterator, callback) {
callback = callback || function () {};
if (!arr.length) {
Something went wrong with that request. Please try again.