@player-ui/async-node-plugin 0.11.0-next.1 → 0.11.0-next.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AsyncNodePlugin.native.js +24 -1
- package/dist/AsyncNodePlugin.native.js.map +1 -1
- package/dist/cjs/index.cjs +9 -1
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/index.legacy-esm.js +9 -1
- package/dist/index.mjs +9 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/__tests__/index.test.ts +149 -0
- package/src/index.ts +14 -1
- package/types/index.d.ts +2 -1
|
@@ -7629,7 +7629,7 @@ var AsyncNodePlugin = function() {
|
|
|
7629
7629
|
};
|
|
7630
7630
|
// ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/async-node/core/src/index.ts
|
|
7631
7631
|
var AsyncNodePlugin = /*#__PURE__*/ function() {
|
|
7632
|
-
function AsyncNodePlugin(options) {
|
|
7632
|
+
function AsyncNodePlugin(options, asyncHandler) {
|
|
7633
7633
|
var _this = this;
|
|
7634
7634
|
_class_call_check(this, AsyncNodePlugin);
|
|
7635
7635
|
this.hooks = {
|
|
@@ -7642,6 +7642,29 @@ var AsyncNodePlugin = function() {
|
|
|
7642
7642
|
plugin.applyPlugin(_this);
|
|
7643
7643
|
});
|
|
7644
7644
|
}
|
|
7645
|
+
if (asyncHandler) {
|
|
7646
|
+
this.hooks.onAsyncNode.tap("async", function() {
|
|
7647
|
+
var _ref = _async_to_generator(function(node, callback) {
|
|
7648
|
+
return _ts_generator(this, function(_state) {
|
|
7649
|
+
switch(_state.label){
|
|
7650
|
+
case 0:
|
|
7651
|
+
return [
|
|
7652
|
+
4,
|
|
7653
|
+
asyncHandler(node, callback)
|
|
7654
|
+
];
|
|
7655
|
+
case 1:
|
|
7656
|
+
return [
|
|
7657
|
+
2,
|
|
7658
|
+
_state.sent()
|
|
7659
|
+
];
|
|
7660
|
+
}
|
|
7661
|
+
});
|
|
7662
|
+
});
|
|
7663
|
+
return function(node, callback) {
|
|
7664
|
+
return _ref.apply(this, arguments);
|
|
7665
|
+
};
|
|
7666
|
+
}());
|
|
7667
|
+
}
|
|
7645
7668
|
}
|
|
7646
7669
|
_create_class(AsyncNodePlugin, [
|
|
7647
7670
|
{
|