@tamagui/use-async 3.0.7 → 3.0.9
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/cjs/errors.native.cjs +15 -24
- package/dist/cjs/errors.native.js +15 -24
- package/dist/cjs/errors.native.js.map +1 -1
- package/dist/cjs/idle.native.cjs +3 -3
- package/dist/cjs/idle.native.js +3 -3
- package/dist/cjs/idle.native.js.map +1 -1
- package/dist/cjs/sleep.native.cjs +1 -1
- package/dist/cjs/sleep.native.js +1 -1
- package/dist/cjs/sleep.native.js.map +1 -1
- package/dist/esm/errors.native.js +15 -24
- package/dist/esm/errors.native.js.map +1 -1
- package/dist/esm/idle.native.js +3 -3
- package/dist/esm/idle.native.js.map +1 -1
- package/dist/esm/sleep.native.js +1 -1
- package/dist/esm/sleep.native.js.map +1 -1
- package/package.json +3 -3
|
@@ -24,9 +24,7 @@ var errors_exports = {};
|
|
|
24
24
|
__export(errors_exports, { AbortError: () => AbortError });
|
|
25
25
|
module.exports = __toCommonJS(errors_exports);
|
|
26
26
|
function _assert_this_initialized(self) {
|
|
27
|
-
if (self === void 0)
|
|
28
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
29
|
-
}
|
|
27
|
+
if (self === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
30
28
|
return self;
|
|
31
29
|
}
|
|
32
30
|
function _call_super(_this, derived, args) {
|
|
@@ -34,14 +32,11 @@ function _call_super(_this, derived, args) {
|
|
|
34
32
|
return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
|
|
35
33
|
}
|
|
36
34
|
function _class_call_check(instance, Constructor) {
|
|
37
|
-
if (!(instance instanceof Constructor))
|
|
38
|
-
throw new TypeError("Cannot call a class as a function");
|
|
39
|
-
}
|
|
35
|
+
if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
|
|
40
36
|
}
|
|
41
37
|
function _construct(Parent, args, Class) {
|
|
42
|
-
if (_is_native_reflect_construct())
|
|
43
|
-
|
|
44
|
-
} else {
|
|
38
|
+
if (_is_native_reflect_construct()) _construct = Reflect.construct;
|
|
39
|
+
else {
|
|
45
40
|
_construct = function construct(Parent2, args2, Class2) {
|
|
46
41
|
var a = [null];
|
|
47
42
|
a.push.apply(a, args2);
|
|
@@ -73,10 +68,16 @@ function _inherits(subClass, superClass) {
|
|
|
73
68
|
function _is_native_function(fn) {
|
|
74
69
|
return Function.toString.call(fn).indexOf("[native code]") !== -1;
|
|
75
70
|
}
|
|
71
|
+
function _is_native_reflect_construct() {
|
|
72
|
+
try {
|
|
73
|
+
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
74
|
+
} catch (_) {}
|
|
75
|
+
return (_is_native_reflect_construct = function() {
|
|
76
|
+
return !!result;
|
|
77
|
+
})();
|
|
78
|
+
}
|
|
76
79
|
function _possible_constructor_return(self, call) {
|
|
77
|
-
if (call && (_type_of(call) === "object" || typeof call === "function"))
|
|
78
|
-
return call;
|
|
79
|
-
}
|
|
80
|
+
if (call && (_type_of(call) === "object" || typeof call === "function")) return call;
|
|
80
81
|
return _assert_this_initialized(self);
|
|
81
82
|
}
|
|
82
83
|
function _set_prototype_of(o, p) {
|
|
@@ -92,11 +93,9 @@ function _type_of(obj) {
|
|
|
92
93
|
}
|
|
93
94
|
function _wrap_native_super(Class) {
|
|
94
95
|
var _cache = typeof Map === "function" ? /* @__PURE__ */ new Map() : void 0;
|
|
95
|
-
_wrap_native_super = function
|
|
96
|
+
_wrap_native_super = function(Class2) {
|
|
96
97
|
if (Class2 === null || !_is_native_function(Class2)) return Class2;
|
|
97
|
-
if (typeof Class2 !== "function")
|
|
98
|
-
throw new TypeError("Super expression must either be null or a function");
|
|
99
|
-
}
|
|
98
|
+
if (typeof Class2 !== "function") throw new TypeError("Super expression must either be null or a function");
|
|
100
99
|
if (typeof _cache !== "undefined") {
|
|
101
100
|
if (_cache.has(Class2)) return _cache.get(Class2);
|
|
102
101
|
_cache.set(Class2, Wrapper);
|
|
@@ -114,14 +113,6 @@ function _wrap_native_super(Class) {
|
|
|
114
113
|
};
|
|
115
114
|
return _wrap_native_super(Class);
|
|
116
115
|
}
|
|
117
|
-
function _is_native_reflect_construct() {
|
|
118
|
-
try {
|
|
119
|
-
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
120
|
-
} catch (_) {}
|
|
121
|
-
return (_is_native_reflect_construct = function() {
|
|
122
|
-
return !!result;
|
|
123
|
-
})();
|
|
124
|
-
}
|
|
125
116
|
var AbortError = /* @__PURE__ */ (function(Error1) {
|
|
126
117
|
"use strict";
|
|
127
118
|
_inherits(AbortError2, Error1);
|
|
@@ -24,9 +24,7 @@ var errors_exports = {};
|
|
|
24
24
|
__export(errors_exports, { AbortError: () => AbortError });
|
|
25
25
|
module.exports = __toCommonJS(errors_exports);
|
|
26
26
|
function _assert_this_initialized(self) {
|
|
27
|
-
if (self === void 0)
|
|
28
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
29
|
-
}
|
|
27
|
+
if (self === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
30
28
|
return self;
|
|
31
29
|
}
|
|
32
30
|
function _call_super(_this, derived, args) {
|
|
@@ -34,14 +32,11 @@ function _call_super(_this, derived, args) {
|
|
|
34
32
|
return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
|
|
35
33
|
}
|
|
36
34
|
function _class_call_check(instance, Constructor) {
|
|
37
|
-
if (!(instance instanceof Constructor))
|
|
38
|
-
throw new TypeError("Cannot call a class as a function");
|
|
39
|
-
}
|
|
35
|
+
if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
|
|
40
36
|
}
|
|
41
37
|
function _construct(Parent, args, Class) {
|
|
42
|
-
if (_is_native_reflect_construct())
|
|
43
|
-
|
|
44
|
-
} else {
|
|
38
|
+
if (_is_native_reflect_construct()) _construct = Reflect.construct;
|
|
39
|
+
else {
|
|
45
40
|
_construct = function construct(Parent2, args2, Class2) {
|
|
46
41
|
var a = [null];
|
|
47
42
|
a.push.apply(a, args2);
|
|
@@ -73,10 +68,16 @@ function _inherits(subClass, superClass) {
|
|
|
73
68
|
function _is_native_function(fn) {
|
|
74
69
|
return Function.toString.call(fn).indexOf("[native code]") !== -1;
|
|
75
70
|
}
|
|
71
|
+
function _is_native_reflect_construct() {
|
|
72
|
+
try {
|
|
73
|
+
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
74
|
+
} catch (_) {}
|
|
75
|
+
return (_is_native_reflect_construct = function() {
|
|
76
|
+
return !!result;
|
|
77
|
+
})();
|
|
78
|
+
}
|
|
76
79
|
function _possible_constructor_return(self, call) {
|
|
77
|
-
if (call && (_type_of(call) === "object" || typeof call === "function"))
|
|
78
|
-
return call;
|
|
79
|
-
}
|
|
80
|
+
if (call && (_type_of(call) === "object" || typeof call === "function")) return call;
|
|
80
81
|
return _assert_this_initialized(self);
|
|
81
82
|
}
|
|
82
83
|
function _set_prototype_of(o, p) {
|
|
@@ -92,11 +93,9 @@ function _type_of(obj) {
|
|
|
92
93
|
}
|
|
93
94
|
function _wrap_native_super(Class) {
|
|
94
95
|
var _cache = typeof Map === "function" ? /* @__PURE__ */ new Map() : void 0;
|
|
95
|
-
_wrap_native_super = function
|
|
96
|
+
_wrap_native_super = function(Class2) {
|
|
96
97
|
if (Class2 === null || !_is_native_function(Class2)) return Class2;
|
|
97
|
-
if (typeof Class2 !== "function")
|
|
98
|
-
throw new TypeError("Super expression must either be null or a function");
|
|
99
|
-
}
|
|
98
|
+
if (typeof Class2 !== "function") throw new TypeError("Super expression must either be null or a function");
|
|
100
99
|
if (typeof _cache !== "undefined") {
|
|
101
100
|
if (_cache.has(Class2)) return _cache.get(Class2);
|
|
102
101
|
_cache.set(Class2, Wrapper);
|
|
@@ -114,14 +113,6 @@ function _wrap_native_super(Class) {
|
|
|
114
113
|
};
|
|
115
114
|
return _wrap_native_super(Class);
|
|
116
115
|
}
|
|
117
|
-
function _is_native_reflect_construct() {
|
|
118
|
-
try {
|
|
119
|
-
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
120
|
-
} catch (_) {}
|
|
121
|
-
return (_is_native_reflect_construct = function() {
|
|
122
|
-
return !!result;
|
|
123
|
-
})();
|
|
124
|
-
}
|
|
125
116
|
var AbortError = /* @__PURE__ */ (function(Error1) {
|
|
126
117
|
"use strict";
|
|
127
118
|
_inherits(AbortError2, Error1);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.native.js","names":[],"sources":["cjs/errors.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar errors_exports = {};\n__export(errors_exports, {\n AbortError: () => AbortError\n});\nmodule.exports = __toCommonJS(errors_exports);\nfunction _assert_this_initialized(self) {\n if (self === void 0)
|
|
1
|
+
{"version":3,"file":"errors.native.js","names":[],"sources":["cjs/errors.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar errors_exports = {};\n__export(errors_exports, {\n AbortError: () => AbortError\n});\nmodule.exports = __toCommonJS(errors_exports);\nfunction _assert_this_initialized(self) {\n if (self === void 0) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n return self;\n}\nfunction _call_super(_this, derived, args) {\n derived = _get_prototype_of(derived);\n return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));\n}\nfunction _class_call_check(instance, Constructor) {\n if (!(instance instanceof Constructor)) throw new TypeError(\"Cannot call a class as a function\");\n}\nfunction _construct(Parent, args, Class) {\n if (_is_native_reflect_construct()) _construct = Reflect.construct;\n else {\n _construct = function construct(Parent2, args2, Class2) {\n var a = [\n null\n ];\n a.push.apply(a, args2);\n var Constructor = Function.bind.apply(Parent2, a);\n var instance = new Constructor();\n if (Class2) _set_prototype_of(instance, Class2.prototype);\n return instance;\n };\n }\n return _construct.apply(null, arguments);\n}\nfunction _get_prototype_of(o) {\n _get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o2) {\n return o2.__proto__ || Object.getPrototypeOf(o2);\n };\n return _get_prototype_of(o);\n}\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) _set_prototype_of(subClass, superClass);\n}\nfunction _is_native_function(fn) {\n return Function.toString.call(fn).indexOf(\"[native code]\") !== -1;\n}\nfunction _is_native_reflect_construct() {\n try {\n var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {\n }));\n } catch (_) {\n }\n return (_is_native_reflect_construct = function() {\n return !!result;\n })();\n}\nfunction _possible_constructor_return(self, call) {\n if (call && (_type_of(call) === \"object\" || typeof call === \"function\")) return call;\n return _assert_this_initialized(self);\n}\nfunction _set_prototype_of(o, p) {\n _set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o2, p2) {\n o2.__proto__ = p2;\n return o2;\n };\n return _set_prototype_of(o, p);\n}\nfunction _type_of(obj) {\n \"@swc/helpers - typeof\";\n return obj && typeof Symbol !== \"undefined\" && obj.constructor === Symbol ? \"symbol\" : typeof obj;\n}\nfunction _wrap_native_super(Class) {\n var _cache = typeof Map === \"function\" ? /* @__PURE__ */ new Map() : void 0;\n _wrap_native_super = function(Class2) {\n if (Class2 === null || !_is_native_function(Class2)) return Class2;\n if (typeof Class2 !== \"function\") throw new TypeError(\"Super expression must either be null or a function\");\n if (typeof _cache !== \"undefined\") {\n if (_cache.has(Class2)) return _cache.get(Class2);\n _cache.set(Class2, Wrapper);\n }\n function Wrapper() {\n return _construct(Class2, arguments, _get_prototype_of(this).constructor);\n }\n Wrapper.prototype = Object.create(Class2.prototype, {\n constructor: {\n value: Wrapper,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n return _set_prototype_of(Wrapper, Class2);\n };\n return _wrap_native_super(Class);\n}\nvar AbortError = /* @__PURE__ */ (function(Error1) {\n \"use strict\";\n _inherits(AbortError2, Error1);\n function AbortError2() {\n var message = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : \"\";\n _class_call_check(this, AbortError2);\n var _this;\n _this = _call_super(this, AbortError2, [\n message\n ]);\n _this.name = \"AbortError\";\n return _this;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CACA,OAAO;AACT,EAAC,CAAE,mBAAmB,KAAK,CAAC"}
|
package/dist/cjs/idle.native.cjs
CHANGED
|
@@ -28,12 +28,12 @@ var import_sleep = require("./sleep.native.js");
|
|
|
28
28
|
var idleCb = typeof requestIdleCallback === "undefined" ? function(cb) {
|
|
29
29
|
return setTimeout(cb, 1);
|
|
30
30
|
} : requestIdleCallback;
|
|
31
|
-
var idleAsync = function() {
|
|
31
|
+
var idleAsync = function idleAsync2() {
|
|
32
32
|
return new Promise(function(res) {
|
|
33
33
|
idleCb(res);
|
|
34
34
|
});
|
|
35
35
|
};
|
|
36
|
-
var idle = async function(signal, options) {
|
|
36
|
+
var idle = async function idle2(signal, options) {
|
|
37
37
|
var { max, min, fully } = options || {};
|
|
38
38
|
var idleFn = fully ? fullyIdle : idleAsync;
|
|
39
39
|
if (max && min && min < max) {
|
|
@@ -49,7 +49,7 @@ var idle = async function(signal, options) {
|
|
|
49
49
|
throw new import_errors.AbortError();
|
|
50
50
|
}
|
|
51
51
|
};
|
|
52
|
-
var fullyIdle = async function(signal) {
|
|
52
|
+
var fullyIdle = async function fullyIdle2(signal) {
|
|
53
53
|
while (true) {
|
|
54
54
|
var startTime = Date.now();
|
|
55
55
|
await idle(signal);
|
package/dist/cjs/idle.native.js
CHANGED
|
@@ -28,12 +28,12 @@ var import_sleep = require("./sleep.native.js");
|
|
|
28
28
|
var idleCb = typeof requestIdleCallback === "undefined" ? function(cb) {
|
|
29
29
|
return setTimeout(cb, 1);
|
|
30
30
|
} : requestIdleCallback;
|
|
31
|
-
var idleAsync = function() {
|
|
31
|
+
var idleAsync = function idleAsync2() {
|
|
32
32
|
return new Promise(function(res) {
|
|
33
33
|
idleCb(res);
|
|
34
34
|
});
|
|
35
35
|
};
|
|
36
|
-
var idle = async function(signal, options) {
|
|
36
|
+
var idle = async function idle2(signal, options) {
|
|
37
37
|
var { max, min, fully } = options || {};
|
|
38
38
|
var idleFn = fully ? fullyIdle : idleAsync;
|
|
39
39
|
if (max && min && min < max) {
|
|
@@ -49,7 +49,7 @@ var idle = async function(signal, options) {
|
|
|
49
49
|
throw new import_errors.AbortError();
|
|
50
50
|
}
|
|
51
51
|
};
|
|
52
|
-
var fullyIdle = async function(signal) {
|
|
52
|
+
var fullyIdle = async function fullyIdle2(signal) {
|
|
53
53
|
while (true) {
|
|
54
54
|
var startTime = Date.now();
|
|
55
55
|
await idle(signal);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"idle.native.js","names":[],"sources":["cjs/idle.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar idle_exports = {};\n__export(idle_exports, {\n idle: () => idle\n});\nmodule.exports = __toCommonJS(idle_exports);\nvar import_errors = require(\"./errors\");\nvar import_sleep = require(\"./sleep\");\nvar idleCb = typeof requestIdleCallback === \"undefined\" ? function(cb) {\n return setTimeout(cb, 1);\n} : requestIdleCallback;\nvar idleAsync = function() {\n return new Promise(function(res) {\n idleCb(res);\n });\n};\nvar idle = async function(signal, options) {\n var { max, min, fully } = options || {};\n var idleFn = fully ? fullyIdle : idleAsync;\n if (max && min && min < max) {\n await Promise.race([\n Promise.all([\n idleFn(),\n (0, import_sleep.sleep)(min)\n ]),\n (0, import_sleep.sleep)(max)\n ]);\n } else if (max) {\n await Promise.race([\n idleFn(),\n (0, import_sleep.sleep)(max)\n ]);\n } else if (min) {\n await Promise.all([\n idleFn(),\n (0, import_sleep.sleep)(min)\n ]);\n } else {\n await idleFn();\n }\n if (signal === null || signal === void 0 ? void 0 : signal.aborted) {\n throw new import_errors.AbortError();\n }\n};\nvar fullyIdle = async function(signal) {\n while (true) {\n var startTime = Date.now();\n await idle(signal);\n var endTime = Date.now();\n var duration = endTime - startTime;\n if (duration < 15) {\n break;\n }\n if (signal === null || signal === void 0 ? void 0 : signal.aborted) {\n throw new import_errors.AbortError();\n }\n }\n};\n//# sourceMappingURL=idle.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,eAAe,CAAC;AACpB,SAAS,cAAc,EACrB,YAAY,KACd,CAAC;AACD,OAAO,UAAU,aAAa,YAAY;AAC1C,IAAI,gBAAgB,QAAQ,oBAAU;AACtC,IAAI,eAAe,QAAQ,mBAAS;AACpC,IAAI,SAAS,OAAO,wBAAwB,cAAc,SAAS,IAAI;CACrE,OAAO,WAAW,IAAI,CAAC;AACzB,IAAI;AACJ,IAAI,YAAY,
|
|
1
|
+
{"version":3,"file":"idle.native.js","names":[],"sources":["cjs/idle.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar idle_exports = {};\n__export(idle_exports, {\n idle: () => idle\n});\nmodule.exports = __toCommonJS(idle_exports);\nvar import_errors = require(\"./errors\");\nvar import_sleep = require(\"./sleep\");\nvar idleCb = typeof requestIdleCallback === \"undefined\" ? function(cb) {\n return setTimeout(cb, 1);\n} : requestIdleCallback;\nvar idleAsync = function idleAsync2() {\n return new Promise(function(res) {\n idleCb(res);\n });\n};\nvar idle = async function idle2(signal, options) {\n var { max, min, fully } = options || {};\n var idleFn = fully ? fullyIdle : idleAsync;\n if (max && min && min < max) {\n await Promise.race([\n Promise.all([\n idleFn(),\n (0, import_sleep.sleep)(min)\n ]),\n (0, import_sleep.sleep)(max)\n ]);\n } else if (max) {\n await Promise.race([\n idleFn(),\n (0, import_sleep.sleep)(max)\n ]);\n } else if (min) {\n await Promise.all([\n idleFn(),\n (0, import_sleep.sleep)(min)\n ]);\n } else {\n await idleFn();\n }\n if (signal === null || signal === void 0 ? void 0 : signal.aborted) {\n throw new import_errors.AbortError();\n }\n};\nvar fullyIdle = async function fullyIdle2(signal) {\n while (true) {\n var startTime = Date.now();\n await idle(signal);\n var endTime = Date.now();\n var duration = endTime - startTime;\n if (duration < 15) {\n break;\n }\n if (signal === null || signal === void 0 ? void 0 : signal.aborted) {\n throw new import_errors.AbortError();\n }\n }\n};\n//# sourceMappingURL=idle.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,eAAe,CAAC;AACpB,SAAS,cAAc,EACrB,YAAY,KACd,CAAC;AACD,OAAO,UAAU,aAAa,YAAY;AAC1C,IAAI,gBAAgB,QAAQ,oBAAU;AACtC,IAAI,eAAe,QAAQ,mBAAS;AACpC,IAAI,SAAS,OAAO,wBAAwB,cAAc,SAAS,IAAI;CACrE,OAAO,WAAW,IAAI,CAAC;AACzB,IAAI;AACJ,IAAI,YAAY,SAAS,aAAa;CACpC,OAAO,IAAI,QAAQ,SAAS,KAAK;EAC/B,OAAO,GAAG;CACZ,CAAC;AACH;AACA,IAAI,OAAO,eAAe,MAAM,QAAQ,SAAS;CAC/C,IAAI,EAAE,KAAK,KAAK,UAAU,WAAW,CAAC;CACtC,IAAI,SAAS,QAAQ,YAAY;CACjC,IAAI,OAAO,OAAO,MAAM,KAAK;EAC3B,MAAM,QAAQ,KAAK,CACjB,QAAQ,IAAI,CACV,OAAO,IACN,GAAG,aAAa,MAAK,CAAE,GAAG,CAC7B,CAAC,IACA,GAAG,aAAa,MAAK,CAAE,GAAG,CAC7B,CAAC;CACH,OAAO,IAAI,KAAK;EACd,MAAM,QAAQ,KAAK,CACjB,OAAO,IACN,GAAG,aAAa,MAAK,CAAE,GAAG,CAC7B,CAAC;CACH,OAAO,IAAI,KAAK;EACd,MAAM,QAAQ,IAAI,CAChB,OAAO,IACN,GAAG,aAAa,MAAK,CAAE,GAAG,CAC7B,CAAC;CACH,OAAO;EACL,MAAM,OAAO;CACf;CACA,IAAI,WAAW,QAAQ,WAAW,KAAK,IAAI,KAAK,IAAI,OAAO,SAAS;EAClE,MAAM,IAAI,cAAc,WAAW;CACrC;AACF;AACA,IAAI,YAAY,eAAe,WAAW,QAAQ;CAChD,OAAO,MAAM;EACX,IAAI,YAAY,KAAK,IAAI;EACzB,MAAM,KAAK,MAAM;EACjB,IAAI,UAAU,KAAK,IAAI;EACvB,IAAI,WAAW,UAAU;EACzB,IAAI,WAAW,IAAI;GACjB;EACF;EACA,IAAI,WAAW,QAAQ,WAAW,KAAK,IAAI,KAAK,IAAI,OAAO,SAAS;GAClE,MAAM,IAAI,cAAc,WAAW;EACrC;CACF;AACF"}
|
|
@@ -24,7 +24,7 @@ var sleep_exports = {};
|
|
|
24
24
|
__export(sleep_exports, { sleep: () => sleep });
|
|
25
25
|
module.exports = __toCommonJS(sleep_exports);
|
|
26
26
|
var import_errors = require("./errors.native.js");
|
|
27
|
-
var sleep = async function(ms, signal) {
|
|
27
|
+
var sleep = async function sleep2(ms, signal) {
|
|
28
28
|
await new Promise(function(res) {
|
|
29
29
|
return setTimeout(res, ms);
|
|
30
30
|
});
|
package/dist/cjs/sleep.native.js
CHANGED
|
@@ -24,7 +24,7 @@ var sleep_exports = {};
|
|
|
24
24
|
__export(sleep_exports, { sleep: () => sleep });
|
|
25
25
|
module.exports = __toCommonJS(sleep_exports);
|
|
26
26
|
var import_errors = require("./errors.native.js");
|
|
27
|
-
var sleep = async function(ms, signal) {
|
|
27
|
+
var sleep = async function sleep2(ms, signal) {
|
|
28
28
|
await new Promise(function(res) {
|
|
29
29
|
return setTimeout(res, ms);
|
|
30
30
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sleep.native.js","names":[],"sources":["cjs/sleep.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar sleep_exports = {};\n__export(sleep_exports, {\n sleep: () => sleep\n});\nmodule.exports = __toCommonJS(sleep_exports);\nvar import_errors = require(\"./errors\");\nvar sleep = async function(ms, signal) {\n await new Promise(function(res) {\n return setTimeout(res, ms);\n });\n if (signal === null || signal === void 0 ? void 0 : signal.aborted) {\n throw new import_errors.AbortError();\n }\n};\n//# sourceMappingURL=sleep.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,gBAAgB,CAAC;AACrB,SAAS,eAAe,EACtB,aAAa,MACf,CAAC;AACD,OAAO,UAAU,aAAa,aAAa;AAC3C,IAAI,gBAAgB,QAAQ,oBAAU;AACtC,IAAI,QAAQ,eAAe,IAAI,QAAQ;
|
|
1
|
+
{"version":3,"file":"sleep.native.js","names":[],"sources":["cjs/sleep.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar sleep_exports = {};\n__export(sleep_exports, {\n sleep: () => sleep\n});\nmodule.exports = __toCommonJS(sleep_exports);\nvar import_errors = require(\"./errors\");\nvar sleep = async function sleep2(ms, signal) {\n await new Promise(function(res) {\n return setTimeout(res, ms);\n });\n if (signal === null || signal === void 0 ? void 0 : signal.aborted) {\n throw new import_errors.AbortError();\n }\n};\n//# sourceMappingURL=sleep.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,gBAAgB,CAAC;AACrB,SAAS,eAAe,EACtB,aAAa,MACf,CAAC;AACD,OAAO,UAAU,aAAa,aAAa;AAC3C,IAAI,gBAAgB,QAAQ,oBAAU;AACtC,IAAI,QAAQ,eAAe,OAAO,IAAI,QAAQ;CAC5C,MAAM,IAAI,QAAQ,SAAS,KAAK;EAC9B,OAAO,WAAW,KAAK,EAAE;CAC3B,CAAC;CACD,IAAI,WAAW,QAAQ,WAAW,KAAK,IAAI,KAAK,IAAI,OAAO,SAAS;EAClE,MAAM,IAAI,cAAc,WAAW;CACrC;AACF"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
function _assert_this_initialized(self) {
|
|
2
|
-
if (self === void 0)
|
|
3
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
4
|
-
}
|
|
2
|
+
if (self === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
5
3
|
return self;
|
|
6
4
|
}
|
|
7
5
|
function _call_super(_this, derived, args) {
|
|
@@ -9,14 +7,11 @@ function _call_super(_this, derived, args) {
|
|
|
9
7
|
return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
|
|
10
8
|
}
|
|
11
9
|
function _class_call_check(instance, Constructor) {
|
|
12
|
-
if (!(instance instanceof Constructor))
|
|
13
|
-
throw new TypeError("Cannot call a class as a function");
|
|
14
|
-
}
|
|
10
|
+
if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
|
|
15
11
|
}
|
|
16
12
|
function _construct(Parent, args, Class) {
|
|
17
|
-
if (_is_native_reflect_construct())
|
|
18
|
-
|
|
19
|
-
} else {
|
|
13
|
+
if (_is_native_reflect_construct()) _construct = Reflect.construct;
|
|
14
|
+
else {
|
|
20
15
|
_construct = function construct(Parent2, args2, Class2) {
|
|
21
16
|
var a = [null];
|
|
22
17
|
a.push.apply(a, args2);
|
|
@@ -48,10 +43,16 @@ function _inherits(subClass, superClass) {
|
|
|
48
43
|
function _is_native_function(fn) {
|
|
49
44
|
return Function.toString.call(fn).indexOf("[native code]") !== -1;
|
|
50
45
|
}
|
|
46
|
+
function _is_native_reflect_construct() {
|
|
47
|
+
try {
|
|
48
|
+
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
49
|
+
} catch (_) {}
|
|
50
|
+
return (_is_native_reflect_construct = function() {
|
|
51
|
+
return !!result;
|
|
52
|
+
})();
|
|
53
|
+
}
|
|
51
54
|
function _possible_constructor_return(self, call) {
|
|
52
|
-
if (call && (_type_of(call) === "object" || typeof call === "function"))
|
|
53
|
-
return call;
|
|
54
|
-
}
|
|
55
|
+
if (call && (_type_of(call) === "object" || typeof call === "function")) return call;
|
|
55
56
|
return _assert_this_initialized(self);
|
|
56
57
|
}
|
|
57
58
|
function _set_prototype_of(o, p) {
|
|
@@ -67,11 +68,9 @@ function _type_of(obj) {
|
|
|
67
68
|
}
|
|
68
69
|
function _wrap_native_super(Class) {
|
|
69
70
|
var _cache = typeof Map === "function" ? /* @__PURE__ */ new Map() : void 0;
|
|
70
|
-
_wrap_native_super = function
|
|
71
|
+
_wrap_native_super = function(Class2) {
|
|
71
72
|
if (Class2 === null || !_is_native_function(Class2)) return Class2;
|
|
72
|
-
if (typeof Class2 !== "function")
|
|
73
|
-
throw new TypeError("Super expression must either be null or a function");
|
|
74
|
-
}
|
|
73
|
+
if (typeof Class2 !== "function") throw new TypeError("Super expression must either be null or a function");
|
|
75
74
|
if (typeof _cache !== "undefined") {
|
|
76
75
|
if (_cache.has(Class2)) return _cache.get(Class2);
|
|
77
76
|
_cache.set(Class2, Wrapper);
|
|
@@ -89,14 +88,6 @@ function _wrap_native_super(Class) {
|
|
|
89
88
|
};
|
|
90
89
|
return _wrap_native_super(Class);
|
|
91
90
|
}
|
|
92
|
-
function _is_native_reflect_construct() {
|
|
93
|
-
try {
|
|
94
|
-
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
95
|
-
} catch (_) {}
|
|
96
|
-
return (_is_native_reflect_construct = function() {
|
|
97
|
-
return !!result;
|
|
98
|
-
})();
|
|
99
|
-
}
|
|
100
91
|
var AbortError = /* @__PURE__ */ (function(Error1) {
|
|
101
92
|
"use strict";
|
|
102
93
|
_inherits(AbortError2, Error1);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.native.js","names":[],"sources":["esm/errors.native.js"],"sourcesContent":["function _assert_this_initialized(self) {\n if (self === void 0)
|
|
1
|
+
{"version":3,"file":"errors.native.js","names":[],"sources":["esm/errors.native.js"],"sourcesContent":["function _assert_this_initialized(self) {\n if (self === void 0) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n return self;\n}\nfunction _call_super(_this, derived, args) {\n derived = _get_prototype_of(derived);\n return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));\n}\nfunction _class_call_check(instance, Constructor) {\n if (!(instance instanceof Constructor)) throw new TypeError(\"Cannot call a class as a function\");\n}\nfunction _construct(Parent, args, Class) {\n if (_is_native_reflect_construct()) _construct = Reflect.construct;\n else {\n _construct = function construct(Parent2, args2, Class2) {\n var a = [\n null\n ];\n a.push.apply(a, args2);\n var Constructor = Function.bind.apply(Parent2, a);\n var instance = new Constructor();\n if (Class2) _set_prototype_of(instance, Class2.prototype);\n return instance;\n };\n }\n return _construct.apply(null, arguments);\n}\nfunction _get_prototype_of(o) {\n _get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o2) {\n return o2.__proto__ || Object.getPrototypeOf(o2);\n };\n return _get_prototype_of(o);\n}\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) _set_prototype_of(subClass, superClass);\n}\nfunction _is_native_function(fn) {\n return Function.toString.call(fn).indexOf(\"[native code]\") !== -1;\n}\nfunction _is_native_reflect_construct() {\n try {\n var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {\n }));\n } catch (_) {\n }\n return (_is_native_reflect_construct = function() {\n return !!result;\n })();\n}\nfunction _possible_constructor_return(self, call) {\n if (call && (_type_of(call) === \"object\" || typeof call === \"function\")) return call;\n return _assert_this_initialized(self);\n}\nfunction _set_prototype_of(o, p) {\n _set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o2, p2) {\n o2.__proto__ = p2;\n return o2;\n };\n return _set_prototype_of(o, p);\n}\nfunction _type_of(obj) {\n \"@swc/helpers - typeof\";\n return obj && typeof Symbol !== \"undefined\" && obj.constructor === Symbol ? \"symbol\" : typeof obj;\n}\nfunction _wrap_native_super(Class) {\n var _cache = typeof Map === \"function\" ? /* @__PURE__ */ new Map() : void 0;\n _wrap_native_super = function(Class2) {\n if (Class2 === null || !_is_native_function(Class2)) return Class2;\n if (typeof Class2 !== \"function\") throw new TypeError(\"Super expression must either be null or a function\");\n if (typeof _cache !== \"undefined\") {\n if (_cache.has(Class2)) return _cache.get(Class2);\n _cache.set(Class2, Wrapper);\n }\n function Wrapper() {\n return _construct(Class2, arguments, _get_prototype_of(this).constructor);\n }\n Wrapper.prototype = Object.create(Class2.prototype, {\n constructor: {\n value: Wrapper,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n return _set_prototype_of(Wrapper, Class2);\n };\n return _wrap_native_super(Class);\n}\nvar AbortError = /* @__PURE__ */ (function(Error1) {\n \"use strict\";\n _inherits(AbortError2, Error1);\n function AbortError2() {\n var message = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : \"\";\n _class_call_check(this, AbortError2);\n var _this;\n _this = _call_super(this, AbortError2, [\n message\n ]);\n _this.name = \"AbortError\";\n return _this;\n }\n return AbortError2;\n})(_wrap_native_super(Error));\nexport {\n AbortError\n};\n//# sourceMappingURL=errors.js.map\n"],"mappings":";AAAA,SAAS,yBAAyB,MAAM;CACtC,IAAI,SAAS,KAAK,GAAG,MAAM,IAAI,eAAe,2DAA2D;CACzG,OAAO;AACT;AACA,SAAS,YAAY,OAAO,SAAS,MAAM;CACzC,UAAU,kBAAkB,OAAO;CACnC,OAAO,6BAA6B,OAAO,6BAA6B,IAAI,QAAQ,UAAU,SAAS,QAAQ,CAAC,GAAG,kBAA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AAU,OAAO,KAAK,IAAI,UAAU,KAAK;EAC/E,kBAAkB,MAAM,WAAW;EACnC,IAAI;EACJ,QAAQ,YAAY,MAAM,aAAa,CACrC,OACF,CAAC;EACD,MAAM,OAAO;EACb,OAAO;CACT;CACA,OAAO;AACT,EAAC,CAAE,mBAAmB,KAAK,CAAC"}
|
package/dist/esm/idle.native.js
CHANGED
|
@@ -4,12 +4,12 @@ import { sleep } from "./sleep.native.js";
|
|
|
4
4
|
var idleCb = typeof requestIdleCallback === "undefined" ? function(cb) {
|
|
5
5
|
return setTimeout(cb, 1);
|
|
6
6
|
} : requestIdleCallback;
|
|
7
|
-
var idleAsync = function() {
|
|
7
|
+
var idleAsync = function idleAsync2() {
|
|
8
8
|
return new Promise(function(res) {
|
|
9
9
|
idleCb(res);
|
|
10
10
|
});
|
|
11
11
|
};
|
|
12
|
-
var idle = async function(signal, options) {
|
|
12
|
+
var idle = async function idle2(signal, options) {
|
|
13
13
|
var { max, min, fully } = options || {};
|
|
14
14
|
var idleFn = fully ? fullyIdle : idleAsync;
|
|
15
15
|
if (max && min && min < max) {
|
|
@@ -25,7 +25,7 @@ var idle = async function(signal, options) {
|
|
|
25
25
|
throw new AbortError();
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
|
-
var fullyIdle = async function(signal) {
|
|
28
|
+
var fullyIdle = async function fullyIdle2(signal) {
|
|
29
29
|
while (true) {
|
|
30
30
|
var startTime = Date.now();
|
|
31
31
|
await idle(signal);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"idle.native.js","names":[],"sources":["esm/idle.native.js"],"sourcesContent":["import { AbortError } from \"./errors\";\nimport { sleep } from \"./sleep\";\nvar idleCb = typeof requestIdleCallback === \"undefined\" ? function(cb) {\n return setTimeout(cb, 1);\n} : requestIdleCallback;\nvar idleAsync = function() {\n return new Promise(function(res) {\n idleCb(res);\n });\n};\nvar idle = async function(signal, options) {\n var { max, min, fully } = options || {};\n var idleFn = fully ? fullyIdle : idleAsync;\n if (max && min && min < max) {\n await Promise.race([\n Promise.all([\n idleFn(),\n sleep(min)\n ]),\n sleep(max)\n ]);\n } else if (max) {\n await Promise.race([\n idleFn(),\n sleep(max)\n ]);\n } else if (min) {\n await Promise.all([\n idleFn(),\n sleep(min)\n ]);\n } else {\n await idleFn();\n }\n if (signal === null || signal === void 0 ? void 0 : signal.aborted) {\n throw new AbortError();\n }\n};\nvar fullyIdle = async function(signal) {\n while (true) {\n var startTime = Date.now();\n await idle(signal);\n var endTime = Date.now();\n var duration = endTime - startTime;\n if (duration < 15) {\n break;\n }\n if (signal === null || signal === void 0 ? void 0 : signal.aborted) {\n throw new AbortError();\n }\n }\n};\nexport {\n idle\n};\n//# sourceMappingURL=idle.js.map\n"],"mappings":";;;;AAEA,IAAI,SAAS,OAAO,wBAAwB,cAAc,SAAS,IAAI;CACrE,OAAO,WAAW,IAAI,CAAC;AACzB,IAAI;AACJ,IAAI,YAAY,
|
|
1
|
+
{"version":3,"file":"idle.native.js","names":[],"sources":["esm/idle.native.js"],"sourcesContent":["import { AbortError } from \"./errors\";\nimport { sleep } from \"./sleep\";\nvar idleCb = typeof requestIdleCallback === \"undefined\" ? function(cb) {\n return setTimeout(cb, 1);\n} : requestIdleCallback;\nvar idleAsync = function idleAsync2() {\n return new Promise(function(res) {\n idleCb(res);\n });\n};\nvar idle = async function idle2(signal, options) {\n var { max, min, fully } = options || {};\n var idleFn = fully ? fullyIdle : idleAsync;\n if (max && min && min < max) {\n await Promise.race([\n Promise.all([\n idleFn(),\n sleep(min)\n ]),\n sleep(max)\n ]);\n } else if (max) {\n await Promise.race([\n idleFn(),\n sleep(max)\n ]);\n } else if (min) {\n await Promise.all([\n idleFn(),\n sleep(min)\n ]);\n } else {\n await idleFn();\n }\n if (signal === null || signal === void 0 ? void 0 : signal.aborted) {\n throw new AbortError();\n }\n};\nvar fullyIdle = async function fullyIdle2(signal) {\n while (true) {\n var startTime = Date.now();\n await idle(signal);\n var endTime = Date.now();\n var duration = endTime - startTime;\n if (duration < 15) {\n break;\n }\n if (signal === null || signal === void 0 ? void 0 : signal.aborted) {\n throw new AbortError();\n }\n }\n};\nexport {\n idle\n};\n//# sourceMappingURL=idle.js.map\n"],"mappings":";;;;AAEA,IAAI,SAAS,OAAO,wBAAwB,cAAc,SAAS,IAAI;CACrE,OAAO,WAAW,IAAI,CAAC;AACzB,IAAI;AACJ,IAAI,YAAY,SAAS,aAAa;CACpC,OAAO,IAAI,QAAQ,SAAS,KAAK;EAC/B,OAAO,GAAG;CACZ,CAAC;AACH;AACA,IAAI,OAAO,eAAe,MAAM,QAAQ,SAAS;CAC/C,IAAI,EAAE,KAAK,KAAK,UAAU,WAAW,CAAC;CACtC,IAAI,SAAS,QAAQ,YAAY;CACjC,IAAI,OAAO,OAAO,MAAM,KAAK;EAC3B,MAAM,QAAQ,KAAK,CACjB,QAAQ,IAAI,CACV,OAAO,GACP,MAAM,GAAG,CACX,CAAC,GACD,MAAM,GAAG,CACX,CAAC;CACH,OAAO,IAAI,KAAK;EACd,MAAM,QAAQ,KAAK,CACjB,OAAO,GACP,MAAM,GAAG,CACX,CAAC;CACH,OAAO,IAAI,KAAK;EACd,MAAM,QAAQ,IAAI,CAChB,OAAO,GACP,MAAM,GAAG,CACX,CAAC;CACH,OAAO;EACL,MAAM,OAAO;CACf;CACA,IAAI,WAAW,QAAQ,WAAW,KAAK,IAAI,KAAK,IAAI,OAAO,SAAS;EAClE,MAAM,IAAI,WAAW;CACvB;AACF;AACA,IAAI,YAAY,eAAe,WAAW,QAAQ;CAChD,OAAO,MAAM;EACX,IAAI,YAAY,KAAK,IAAI;EACzB,MAAM,KAAK,MAAM;EACjB,IAAI,UAAU,KAAK,IAAI;EACvB,IAAI,WAAW,UAAU;EACzB,IAAI,WAAW,IAAI;GACjB;EACF;EACA,IAAI,WAAW,QAAQ,WAAW,KAAK,IAAI,KAAK,IAAI,OAAO,SAAS;GAClE,MAAM,IAAI,WAAW;EACvB;CACF;AACF"}
|
package/dist/esm/sleep.native.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sleep.native.js","names":[],"sources":["esm/sleep.native.js"],"sourcesContent":["import { AbortError } from \"./errors\";\nvar sleep = async function(ms, signal) {\n await new Promise(function(res) {\n return setTimeout(res, ms);\n });\n if (signal === null || signal === void 0 ? void 0 : signal.aborted) {\n throw new AbortError();\n }\n};\nexport {\n sleep\n};\n//# sourceMappingURL=sleep.js.map\n"],"mappings":";;;AACA,IAAI,QAAQ,eAAe,IAAI,QAAQ;
|
|
1
|
+
{"version":3,"file":"sleep.native.js","names":[],"sources":["esm/sleep.native.js"],"sourcesContent":["import { AbortError } from \"./errors\";\nvar sleep = async function sleep2(ms, signal) {\n await new Promise(function(res) {\n return setTimeout(res, ms);\n });\n if (signal === null || signal === void 0 ? void 0 : signal.aborted) {\n throw new AbortError();\n }\n};\nexport {\n sleep\n};\n//# sourceMappingURL=sleep.js.map\n"],"mappings":";;;AACA,IAAI,QAAQ,eAAe,OAAO,IAAI,QAAQ;CAC5C,MAAM,IAAI,QAAQ,SAAS,KAAK;EAC9B,OAAO,WAAW,KAAK,EAAE;CAC3B,CAAC;CACD,IAAI,WAAW,QAAQ,WAAW,KAAK,IAAI,KAAK,IAAI,OAAO,SAAS;EAClE,MAAM,IAAI,WAAW;CACvB;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/use-async",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.9",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"files": [
|
|
6
6
|
"src",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"clean:build": "tamagui-build clean:build"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@tamagui/build": "3.0.
|
|
37
|
+
"@tamagui/build": "3.0.9",
|
|
38
38
|
"react": "19.2.3"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"url": "git+https://github.com/tamagui/tamagui.git",
|
|
46
46
|
"directory": "code/packages/use-async"
|
|
47
47
|
},
|
|
48
|
-
"releaseSourceCommit": "
|
|
48
|
+
"releaseSourceCommit": "1971272fa9915450004c84ea48188100fdf278ff"
|
|
49
49
|
}
|