decord/source/hooks/useRequest.tsx

135 lines
4 KiB
TypeScript
Raw Normal View History

// Module ID: 12296
// Function ID: 12297
2026-07-20 16:05:17 +00:00
// Name: useRequest
// Dependencies: [5, 32, 19, 1114, 4508, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
// Module 12296 (useRequest)
import asyncGeneratorStep from "asyncGeneratorStep" /* 5 */;
import _slicedToArray from "module_32" /* 32 */;
import noop from "module_19" /* 19 */;
2026-07-23 10:11:24 +00:00
const require = fn;
const size = fn(2);
const result = size.fileFinishedImporting("hooks/useRequest.tsx");
2026-07-20 16:05:17 +00:00
export default function useRequest(arg0) {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
const tmp = _slicedToArray(noop.useState(false), 2);
2026-08-24 06:08:38 +00:00
closure_1 = tmp[1];
const tmp2 = _slicedToArray(noop.useState(null), 2);
2026-08-24 06:08:38 +00:00
closure_2 = tmp2[1];
2026-07-29 08:29:29 +00:00
let items = [arg0];
const items1 = [
noop.useCallback(asyncGeneratorStep(async () => {
2026-08-24 06:08:38 +00:00
closure_0 = [...arguments];
c5 = 0;
c6 = 0;
c4 = 0;
const iter = (async (arg0, value) => {
2026-07-29 08:29:29 +00:00
if (c6 === 2) {
c6 = 3;
throw new TypeError("Generator functions may not be called on executing generators");
2026-07-29 08:29:29 +00:00
} else if (tmp8 === 3) {
if (arg0 === 1) {
throw value;
2026-07-29 08:29:29 +00:00
} else if (arg0 === 2) {
const obj2 = { value, done: true };
return obj2;
2026-07-29 08:29:29 +00:00
} else {
2026-09-01 10:26:29 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
}
} else {
try {
c6 = 2;
if (0 === c5) {
if (arg0 === 1) {
c6 = 3;
throw value;
2026-07-29 08:29:29 +00:00
} else if (arg0 === 2) {
c6 = 3;
const obj3 = { value, done: true };
return obj3;
2026-07-29 08:29:29 +00:00
} else {
closure_129_0 = closure_0;
2026-07-29 08:29:29 +00:00
c5 = 1;
c6 = 1;
return { value: "PX_16", done: null };
2026-07-29 08:29:29 +00:00
}
} else if (1 === tmp9) {
if (arg0 === 1) {
c6 = 3;
throw value;
2026-07-29 08:29:29 +00:00
} else if (arg0 === 2) {
c6 = 3;
const obj4 = { value, done: true };
return obj4;
2026-07-29 08:29:29 +00:00
} else {
2026-08-24 06:08:38 +00:00
c4 = 2;
closure_130_2(null);
closure_130_1(true);
2026-07-29 08:29:29 +00:00
const items = [];
HermesBuiltin.arraySpread(closure_129_0, 0);
2026-07-29 08:29:29 +00:00
c5 = 4;
c6 = 1;
const obj5 = { value: HermesBuiltin.apply(items, undefined), done: false };
return obj5;
2026-07-29 08:29:29 +00:00
}
} else if (2 === tmp9) {
c4 = 0;
closure_130_1(false);
2026-08-24 06:08:38 +00:00
throw closure_3;
2026-07-29 08:29:29 +00:00
} else if (3 === tmp9) {
c4 = 1;
closure_129_1 = closure_3;
const intl = closure_0(tmp4[3]).intl;
if (closure_129_1.message === intl.string(closure_0(tmp4[3]).t.N2yb9a)) {
2026-07-29 08:29:29 +00:00
c4 = 0;
closure_130_1(false);
2026-07-29 08:29:29 +00:00
c6 = 3;
2026-09-01 10:26:29 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
} else {
if (closure_129_1 instanceof tmp6(tmp4[4])) {
let tmp37 = closure_129_1;
2026-07-29 08:29:29 +00:00
} else {
tmp37 = new tmp6(tmp4[4])(closure_129_1);
2026-07-29 08:29:29 +00:00
}
closure_130_2(tmp37);
2026-07-29 08:29:29 +00:00
}
} else if (arg0 === 1) {
c6 = 3;
throw value;
2026-07-29 08:29:29 +00:00
} else if (arg0 === 2) {
c4 = 0;
closure_130_1(false);
2026-07-29 08:29:29 +00:00
c6 = 3;
const obj6 = { value, done: true };
return obj6;
2026-07-29 08:29:29 +00:00
} else {
c4 = 0;
closure_130_1(false);
2026-07-29 08:29:29 +00:00
c6 = 3;
const obj = { value, done: true };
2026-07-29 08:29:29 +00:00
return obj;
}
} catch (tmp60) {
2026-08-24 06:08:38 +00:00
closure_3 = tmp60;
2026-07-29 08:29:29 +00:00
if (tmp5 === c4) {
c6 = tmp3;
throw tmp60;
} else if (tmp2 === tmp62) {
c5 = tmp;
} else {
c5 = tmp3;
}
}
}
})();
iter.next();
return iter;
}), items),
{ loading: tmp[0], error: tmp2[0] }
];
2026-07-20 16:05:17 +00:00
return items1;
};