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

138 lines
3.6 KiB
TypeScript
Raw Normal View History

2026-07-29 08:29:29 +00:00
// Module ID: 5906
// Function ID: 5907
2026-07-20 16:05:17 +00:00
// Name: importDefaultResult1
2026-07-29 08:29:29 +00:00
// Dependencies: [5, 19, 4210, 676, 589, 687, 5907, 2]
2026-07-20 16:05:17 +00:00
// Exports: useGames
2026-07-29 08:29:29 +00:00
// Module 5906 (importDefaultResult1)
import noop from "noop";
import importDefaultResult1 from "map";
2026-07-23 10:11:24 +00:00
import initialize from "initialize";
import importDefaultResult from "set";
const require = arg1;
initialize = {
getQueryId: require("ME").QueryIds.GAME,
failureStaleAfter: 15 * require("set").Seconds.SECOND,
2026-07-29 08:29:29 +00:00
get(gameId) {
if (null == gameId) {
2026-07-20 16:05:17 +00:00
return null;
} else {
2026-07-29 08:29:29 +00:00
if (importDefaultResult1.hasNoData(gameId)) {
let NO_DATA = require(589) /* initialize */.NO_DATA;
} else {
NO_DATA = obj.getGame(gameId);
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-07-29 08:29:29 +00:00
let closure_2 = require("set")((arg0) => {
let closure_0 = arg0;
let c2 = 0;
let c1 = 0;
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 {
return { value: "HermesInternal", done: null };
}
} 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) {
let obj1 = callback(table[6]);
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;
return { value: "HermesInternal", done: null };
} 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-07-29 08:29:29 +00:00
initialize[5] = function getError(gameId) {
2026-07-20 16:05:17 +00:00
let error = null;
2026-07-29 08:29:29 +00:00
if (null != gameId) {
2026-07-20 16:05:17 +00:00
error = null;
2026-07-29 08:29:29 +00:00
if (importDefaultResult1.didFetchingFail(gameId)) {
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-07-29 08:29:29 +00:00
const result = require("map").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-07-23 10:11:24 +00:00
let closure_0 = memo;
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-07-23 10:11:24 +00:00
outer1_5.fetchMany.apply(items);
2026-07-20 16:05:17 +00:00
}, items);
};