@antv/async-hook
Advanced tools
Comparing version 2.2.2 to 2.2.3
@@ -1610,3 +1610,36 @@ /****************************************************************************** | ||
export { AsyncParallelHook, AsyncSeriesHook, SyncBailHook, SyncHook, SyncWaterfallHook }; | ||
var AsyncSeriesBailHook = (function () { | ||
function AsyncSeriesBailHook() { | ||
this.args = []; | ||
this.tasks = []; | ||
} | ||
AsyncSeriesBailHook.prototype.promise = function () { | ||
var arguments$1 = arguments; | ||
var args = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i] = arguments$1[_i]; | ||
} | ||
this.args = args; | ||
return series(this.tasks); | ||
}; | ||
AsyncSeriesBailHook.prototype.tapPromise = function (name, cb) { | ||
var _this = this; | ||
this.tasks.push(function (callback) { return __awaiter(_this, void 0, void 0, function () { | ||
var err; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4, cb.apply(void 0, __spreadArray([], __read(this.args), false))]; | ||
case 1: | ||
err = _a.sent(); | ||
callback(err, name); | ||
return [2]; | ||
} | ||
}); | ||
}); }); | ||
}; | ||
return AsyncSeriesBailHook; | ||
}()); | ||
export { AsyncParallelHook, AsyncSeriesBailHook, AsyncSeriesHook, SyncBailHook, SyncHook, SyncWaterfallHook }; | ||
//# sourceMappingURL=index.js.map |
@@ -1614,3 +1614,37 @@ 'use strict'; | ||
var AsyncSeriesBailHook = (function () { | ||
function AsyncSeriesBailHook() { | ||
this.args = []; | ||
this.tasks = []; | ||
} | ||
AsyncSeriesBailHook.prototype.promise = function () { | ||
var arguments$1 = arguments; | ||
var args = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i] = arguments$1[_i]; | ||
} | ||
this.args = args; | ||
return series(this.tasks); | ||
}; | ||
AsyncSeriesBailHook.prototype.tapPromise = function (name, cb) { | ||
var _this = this; | ||
this.tasks.push(function (callback) { return __awaiter(_this, void 0, void 0, function () { | ||
var err; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4, cb.apply(void 0, __spreadArray([], __read(this.args), false))]; | ||
case 1: | ||
err = _a.sent(); | ||
callback(err, name); | ||
return [2]; | ||
} | ||
}); | ||
}); }); | ||
}; | ||
return AsyncSeriesBailHook; | ||
}()); | ||
exports.AsyncParallelHook = AsyncParallelHook; | ||
exports.AsyncSeriesBailHook = AsyncSeriesBailHook; | ||
exports.AsyncSeriesHook = AsyncSeriesHook; | ||
@@ -1617,0 +1651,0 @@ exports.SyncBailHook = SyncBailHook; |
{ | ||
"name": "@antv/async-hook", | ||
"version": "2.2.2", | ||
"version": "2.2.3", | ||
"description": "the control flow for l7", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -6,1 +6,2 @@ export { default as SyncHook } from './core/SyncHook'; | ||
export { default as AsyncSeriesHook } from './core/AsyncSeriesHook'; | ||
export { default as AsyncSeriesBailHook } from './core/AsyncSeriesBailhook'; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
285349
15
2897