source: trip-planner-front/node_modules/tapable/lib/AsyncParallelHook.js@ 59329aa

Last change on this file since 59329aa was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 877 bytes
Line 
1/*
2 MIT License http://www.opensource.org/licenses/mit-license.php
3 Author Tobias Koppers @sokra
4*/
5"use strict";
6
7const Hook = require("./Hook");
8const HookCodeFactory = require("./HookCodeFactory");
9
10class AsyncParallelHookCodeFactory extends HookCodeFactory {
11 content({ onError, onDone }) {
12 return this.callTapsParallel({
13 onError: (i, err, done, doneBreak) => onError(err) + doneBreak(true),
14 onDone
15 });
16 }
17}
18
19const factory = new AsyncParallelHookCodeFactory();
20
21const COMPILE = function(options) {
22 factory.setup(this, options);
23 return factory.create(options);
24};
25
26function AsyncParallelHook(args = [], name = undefined) {
27 const hook = new Hook(args, name);
28 hook.constructor = AsyncParallelHook;
29 hook.compile = COMPILE;
30 hook._call = undefined;
31 hook.call = undefined;
32 return hook;
33}
34
35AsyncParallelHook.prototype = null;
36
37module.exports = AsyncParallelHook;
Note: See TracBrowser for help on using the repository browser.