decord/source/modules/applications/useGetOrFetchApplications.tsx

88 lines
2.6 KiB
TypeScript
Raw Normal View History

2026-08-27 16:17:25 +00:00
// Module ID: 5911
// Function ID: 5912
2026-07-20 16:05:17 +00:00
// Name: useGetOrFetchApplications
2026-08-27 16:17:25 +00:00
// Dependencies: [19, 4486, 643, 5906, 12, 1370, 589, 2]
2026-07-29 08:29:29 +00:00
// Exports: default, useGetOrFetchApplication
2026-07-20 16:05:17 +00:00
2026-08-27 16:17:25 +00:00
// Module 5911 (useGetOrFetchApplications)
2026-08-24 06:08:38 +00:00
import closure_3 from "noop" /* 19 */;
2026-08-27 16:17:25 +00:00
import closure_4 from "addApplication" /* 4486 */;
2026-07-20 16:05:17 +00:00
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("modules/applications/useGetOrFetchApplications.tsx");
2026-07-29 08:29:29 +00:00
export default function useGetOrFetchApplications(arg0) {
2026-07-23 10:11:24 +00:00
const _require = arg0;
2026-07-29 08:29:29 +00:00
let flag = arg1;
2026-07-20 16:05:17 +00:00
if (arg1 === undefined) {
flag = true;
}
2026-08-24 06:08:38 +00:00
dependencyMap = undefined;
2026-07-23 10:11:24 +00:00
dependencyMap = React.useRef([]);
2026-07-20 16:05:17 +00:00
const items = [arg0, flag];
const effect = React.useEffect(() => {
let tmp = flag;
if (flag) {
2026-07-29 08:29:29 +00:00
tmp = !items1(ref[2]).areArraysShallowEqual(items1, ref.current);
const obj = items1(ref[2]);
2026-07-20 16:05:17 +00:00
}
if (tmp) {
const obj2 = flag(ref[3]);
2026-07-29 08:29:29 +00:00
const found = flag(ref[4])(items1).filter(items1(ref[5]).isNotNullish);
const arr = flag(ref[4])(items1);
2026-07-20 16:05:17 +00:00
const applications = obj2.fetchApplications(found.uniq().value(), false);
2026-07-29 08:29:29 +00:00
ref.current = items1;
2026-07-20 16:05:17 +00:00
const iter = found.uniq();
}
}, items);
2026-08-24 06:08:38 +00:00
const items1 = [closure_4];
2026-07-29 08:29:29 +00:00
return _require(589).useStateFromStoresArray(items1, () => items1.map((arg0) => {
2026-07-20 16:05:17 +00:00
let application;
2026-07-29 08:29:29 +00:00
if (null != arg0) {
application = application.getApplication(arg0);
2026-07-20 16:05:17 +00:00
}
return application;
}));
2026-07-29 08:29:29 +00:00
};
2026-07-20 16:05:17 +00:00
export const useGetOrFetchApplication = function useGetOrFetchApplication(applicationId, fetchesApplication) {
let flag = fetchesApplication;
if (fetchesApplication === undefined) {
flag = true;
}
if (null != applicationId) {
const items = [applicationId];
let items1 = items;
} else {
items1 = [];
}
2026-07-29 08:29:29 +00:00
if (flag === undefined) {
flag = true;
}
2026-08-24 06:08:38 +00:00
dependencyMap = undefined;
2026-07-29 08:29:29 +00:00
dependencyMap = React.useRef([]);
const items2 = [items1, flag];
const effect = React.useEffect(() => {
let tmp = flag;
if (flag) {
tmp = !items1(ref[2]).areArraysShallowEqual(items1, ref.current);
const obj = items1(ref[2]);
}
if (tmp) {
const obj2 = flag(ref[3]);
const found = flag(ref[4])(items1).filter(items1(ref[5]).isNotNullish);
const arr = flag(ref[4])(items1);
const applications = obj2.fetchApplications(found.uniq().value(), false);
ref.current = items1;
const iter = found.uniq();
}
}, items2);
2026-08-24 06:08:38 +00:00
const items3 = [closure_4];
2026-07-29 08:29:29 +00:00
return items1(589).useStateFromStoresArray(items3, () => items1.map((arg0) => {
let application;
if (null != arg0) {
application = application.getApplication(arg0);
}
return application;
}))[0];
2026-07-20 16:05:17 +00:00
};