BVB Source Codes

reactide Show index.js Source code

Return Download reactide: download index.js Source code - Download reactide Source code - Type:.js
  1. // async-each MIT license (by Paul Miller from http://paulmillr.com).
  2. (function(globals) {
  3.   'use strict';
  4.   var each = function(items, next, callback) {
  5.     if (!Array.isArray(items)) throw new TypeError('each() expects array as first argument');
  6.     if (typeof next !== 'function') throw new TypeError('each() expects function as second argument');
  7.     if (typeof callback !== 'function') callback = Function.prototype; // no-op
  8.  
  9.     if (items.length === 0) return callback(undefined, items);
  10.  
  11.     var transformed = new Array(items.length);
  12.     var count = 0;
  13.     var returned = false;
  14.  
  15.     items.forEach(function(item, index) {
  16.       next(item, function(error, transformedItem) {
  17.         if (returned) return;
  18.         if (error) {
  19.           returned = true;
  20.           return callback(error);
  21.         }
  22.         transformed[index] = transformedItem;
  23.         count += 1;
  24.         if (count === items.length) return callback(undefined, transformed);
  25.       });
  26.     });
  27.   };
  28.  
  29.   if (typeof define !== 'undefined' && define.amd) {
  30.     define([], function() {
  31.       return each;
  32.     }); // RequireJS
  33.   } else if (typeof module !== 'undefined' && module.exports) {
  34.     module.exports = each; // CommonJS
  35.   } else {
  36.     globals.asyncEach = each; // <script>
  37.   }
  38. })(this);
  39.  
downloadindex.js Source code - Download reactide Source code
Related Source Codes/Software:
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
postal - 2017-06-11
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top