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.

AsyncParallelHook.js 768B

1234567891011121314151617181920212223242526272829303132
  1. /*
  2. MIT License http://www.opensource.org/licenses/mit-license.php
  3. Author Tobias Koppers @sokra
  4. */
  5. "use strict";
  6. const Hook = require("./Hook");
  7. const HookCodeFactory = require("./HookCodeFactory");
  8. class AsyncParallelHookCodeFactory extends HookCodeFactory {
  9. content({ onError, onDone }) {
  10. return this.callTapsParallel({
  11. onError: (i, err, done, doneBreak) => onError(err) + doneBreak(true),
  12. onDone
  13. });
  14. }
  15. }
  16. const factory = new AsyncParallelHookCodeFactory();
  17. class AsyncParallelHook extends Hook {
  18. compile(options) {
  19. factory.setup(this, options);
  20. return factory.create(options);
  21. }
  22. }
  23. Object.defineProperties(AsyncParallelHook.prototype, {
  24. _call: { value: undefined, configurable: true, writable: true }
  25. });
  26. module.exports = AsyncParallelHook;