decord/source/modules/games/hooks/useGame.tsx

139 lines
3.7 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 5383
// Function ID: 5384
2026-07-20 16:05:17 +00:00
// Name: importDefaultResult1
2026-08-24 06:08:38 +00:00
// Dependencies: [5, 19, 4509, 676, 589, 687, 5384, 2]
2026-07-20 16:05:17 +00:00
// Exports: useGames
2026-08-24 06:08:38 +00:00
// Module 5383 (importDefaultResult1)
import setDefault from "set" /* 687 */;
import closure_3 from "noop" /* 19 */;
import importDefaultResult1 from "handleLoadMessages" /* 4509 */;
import initialize from "initialize" /* 589 */;
import importDefaultResult from "asyncGeneratorStep" /* 5 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
initialize = {
getQueryId: require("ME").QueryIds.GAME,
2026-08-24 06:08:38 +00:00
failureStaleAfter: 15 * setDefault.Seconds.SECOND,
2026-08-05 07:35:12 +00:00
get(closure_0) {
if (null == closure_0) {
2026-07-20 16:05:17 +00:00
return null;
} else {
2026-08-05 07:35:12 +00:00
if (importDefaultResult1.hasNoData(closure_0)) {
2026-07-29 08:29:29 +00:00
let NO_DATA = require(589) /* initialize */.NO_DATA;
} else {
2026-08-05 07:35:12 +00:00
NO_DATA = obj.getGame(closure_0);
2026-07-29 08:29:29 +00:00
if (NO_DATA == null) {
NO_DATA = null;
}
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj = importDefaultResult1;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
},
load: null,
getIsLoading: null,
getError: null
2026-07-20 16:05:17 +00:00
};
2026-08-24 06:08:38 +00:00
let closure_2 = importDefaultResult((arg0) => {
closure_0 = arg0;
c2 = 0;
c1 = 0;
2026-07-29 08:29:29 +00:00
return (function*(arg0) {
if (table === 2) {
table = 3;
HermesBuiltin.throwTypeError();
} else if (tmp3 === 3) {
if (arg0 === 1) {
throw arg1;
} else if (arg0 === 2) {
let obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
2026-08-24 06:08:38 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
}
} else {
try {
table = 2;
if (0 === c2) {
if (arg0 === 1) {
table = 3;
throw arg1;
} else if (arg0 === 2) {
table = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else if (null != callback) {
2026-08-24 06:08:38 +00:00
obj1 = callback(table[6]);
2026-07-29 08:29:29 +00:00
const items = [tmp5];
c2 = 1;
table = 1;
obj1 = { value: null, done: false };
obj1[0] = obj1.fetchGamesWithSupplementalData(items);
return obj1;
}
} else if (arg0 === 1) {
table = 3;
throw arg1;
} else if (arg0 === 2) {
table = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
}
table = 3;
2026-08-24 06:08:38 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
} catch (tmp9) {
table = tmp;
throw tmp9;
}
}
})();
2026-07-20 16:05:17 +00:00
});
2026-07-29 08:29:29 +00:00
initialize[3] = function() {
const self = this;
const apply = closure_2.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
initialize[4] = function getIsLoading(arg0) {
let isFetchingResult = null != arg0;
2026-07-20 16:05:17 +00:00
if (isFetchingResult) {
2026-07-29 08:29:29 +00:00
isFetchingResult = importDefaultResult1.isFetching(arg0);
2026-07-20 16:05:17 +00:00
}
return isFetchingResult;
};
2026-08-05 07:35:12 +00:00
initialize[5] = function getError(closure_0) {
2026-08-24 06:08:38 +00:00
error = null;
2026-08-05 07:35:12 +00:00
if (null != closure_0) {
2026-07-20 16:05:17 +00:00
error = null;
2026-08-05 07:35:12 +00:00
if (importDefaultResult1.didFetchingFail(closure_0)) {
2026-07-20 16:05:17 +00:00
const _Error = Error;
error = new Error("Failed to fetch game data");
}
}
return error;
};
2026-07-23 10:11:24 +00:00
const fetchStore = initialize.createFetchStore(importDefaultResult1, initialize);
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("modules/games/hooks/useGame.tsx");
2026-07-20 16:05:17 +00:00
export const useGame = fetchStore;
export const useGames = function useGames(memo) {
2026-08-24 06:08:38 +00:00
closure_0 = memo;
2026-07-23 10:11:24 +00:00
let items = [memo];
2026-07-20 16:05:17 +00:00
const effect = React.useEffect(() => {
2026-07-23 10:11:24 +00:00
let items = [
2026-07-20 16:05:17 +00:00
...closure_0.map((arg0) => {
const items = [arg0];
return items;
})
];
2026-08-24 06:08:38 +00:00
closure_1_5.fetchMany.apply(items);
2026-07-20 16:05:17 +00:00
}, items);
};