How to use the vendors/async/lib/async.forEach function in vendors

To help you get started, we’ve selected a few vendors examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github CERNDocumentServer / cds-videos / cds / modules / personal_collection / static / js / personal_collection / ui / box.js View on Github external
this.init = function(ev, data) {
      // Empty the space
      var that = this;
      var boxes = that.attr.storage.all();
      that.$node.empty();
      async.forEach(
        boxes,
        function(box, callback) {
          // add the box Skeleton
          that._addBoxSkeleton(box);
          // callback for the next one
          callback();
        },
        function(error) {
          if (error) {
            that._error(error);
          }
          // Trigger render boxes to normal mode
          that.trigger(document, 'personal.boxes.ui.normal', {
            ids: _.pluck(boxes, 'id')
          });
          that.trigger(document, 'personal.boxes.ui.initizalized');
github CERNDocumentServer / cds-videos / cds / modules / personal_collection / static / js / personal_collection / ui / box.js View on Github external
this.processView = function(target, args, state) {
      var that = this;
      var isElement = _.isElement(target);
      var ids = isElement ? [that._getIDFromTarget(target)] : args.ids;
      async.forEach(ids, function(id, callback) {
        that._processBox(id, state);
        callback();
      }, function(error) {
          if (error) {
            that._error(error);
          }
      });
    };