Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

parallel.js 956B

12345678910111213141516171819202122232425262728293031323334
  1. 'use strict';
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. var _isArrayLike = require('./isArrayLike');
  6. var _isArrayLike2 = _interopRequireDefault(_isArrayLike);
  7. var _wrapAsync = require('./wrapAsync');
  8. var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
  9. var _awaitify = require('./awaitify');
  10. var _awaitify2 = _interopRequireDefault(_awaitify);
  11. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  12. exports.default = (0, _awaitify2.default)((eachfn, tasks, callback) => {
  13. var results = (0, _isArrayLike2.default)(tasks) ? [] : {};
  14. eachfn(tasks, (task, key, taskCb) => {
  15. (0, _wrapAsync2.default)(task)((err, ...result) => {
  16. if (result.length < 2) {
  17. [result] = result;
  18. }
  19. results[key] = result;
  20. taskCb(err);
  21. });
  22. }, err => callback(err, results));
  23. }, 3);
  24. module.exports = exports['default'];