decord/source/utils/NetworkUtils.tsx

39 lines
1,008 B
TypeScript
Raw Normal View History

// Module ID: 1461
// Function ID: 1462
2026-07-20 16:05:17 +00:00
// Name: awaitOnline
// Dependencies: [1462, 2]
2026-07-20 16:05:17 +00:00
// Module 1461 (awaitOnline)
2026-08-24 06:08:38 +00:00
import set from "set" /* 2 */;
import notifyListeners from "notifyListeners" /* 1462 */;
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 = {};
2026-08-24 06:08:38 +00:00
const merged = Object.assign(notifyListeners.default);
2026-07-29 08:29:29 +00:00
obj.awaitOnline = function awaitOnline() {
2026-07-20 16:05:17 +00:00
return new Promise((arg0) => {
if (_default.isOnline()) {
return arg0();
} else {
2026-07-29 08:29:29 +00:00
function whenOnline(arg0) {
2026-08-24 06:08:38 +00:00
const item = closure_1_2.forEach((arg0) => arg0());
closure_1_2.length = 0;
c3 = false;
whenOnline(closure_1_1[0]).default.removeOnlineCallback(whenOnline);
2026-07-29 08:29:29 +00:00
}
arr = arr.push(arg0);
if (!c3) {
c3 = true;
tmp(tmp2[0]).default.addOnlineCallback(whenOnline);
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
_default = whenOnline(table[0]).default;
tmp = whenOnline;
tmp2 = table;
2026-07-20 16:05:17 +00:00
});
};
2026-08-24 06:08:38 +00:00
const result = set.fileFinishedImporting("utils/NetworkUtils.tsx");
2026-07-20 16:05:17 +00:00
export default obj;