decord/alpha/source/utils/NetworkUtils.tsx

38 lines
979 B
TypeScript
Raw Normal View History

// Module ID: 1462
// Function ID: 1463
// Name: NetworkUtils
// Dependencies: [1463, 2]
2026-07-20 16:05:17 +00:00
// Module 1462 (NetworkUtils)
import utils_NetworkUtils from "utils/NetworkUtils" /* 1463 */;
import size from "module_2" /* 2 */;
2026-08-24 06:08:38 +00:00
2026-07-20 16:05:17 +00:00
let closure_2 = [];
2026-07-23 10:11:24 +00:00
let c3 = false;
2026-07-20 16:05:17 +00:00
const obj = {};
const merged = Object.assign(utils_NetworkUtils.default);
2026-07-29 08:29:29 +00:00
obj.awaitOnline = function awaitOnline() {
return new Promise((fn) => {
2026-07-20 16:05:17 +00:00
if (_default.isOnline()) {
return fn();
2026-07-20 16:05:17 +00:00
} else {
function whenOnline() {
const item = closure_2_2.forEach((fn) => fn());
closure_2_2.length = 0;
2026-08-24 06:08:38 +00:00
c3 = false;
utils_NetworkUtils.default.removeOnlineCallback(whenOnline);
2026-07-29 08:29:29 +00:00
}
closure_2.push(fn);
2026-07-29 08:29:29 +00:00
if (!c3) {
c3 = true;
tmp(1463).default.addOnlineCallback(whenOnline);
2026-07-20 16:05:17 +00:00
}
}
_default = whenOnline(1463).default;
2026-07-29 08:29:29 +00:00
tmp = whenOnline;
2026-07-20 16:05:17 +00:00
});
};
const result = size.fileFinishedImporting("utils/NetworkUtils.tsx");
2026-07-20 16:05:17 +00:00
export default obj;