1
|
/*
|
2
|
MIT License http://www.opensource.org/licenses/mit-license.php
|
3
|
Author Tobias Koppers @sokra
|
4
|
*/
|
5
|
"use strict";
|
6
|
|
7
|
const Hook = require("./Hook");
|
8
|
const HookCodeFactory = require("./HookCodeFactory");
|
9
|
|
10
|
class 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
|
|
19
|
const factory = new AsyncParallelHookCodeFactory();
|
20
|
|
21
|
class AsyncParallelHook extends Hook {
|
22
|
compile(options) {
|
23
|
factory.setup(this, options);
|
24
|
return factory.create(options);
|
25
|
}
|
26
|
}
|
27
|
|
28
|
Object.defineProperties(AsyncParallelHook.prototype, {
|
29
|
_call: { value: undefined, configurable: true, writable: true }
|
30
|
});
|
31
|
|
32
|
module.exports = AsyncParallelHook;
|