decord/source/modules/applications/useGetOrFetchApplications.tsx

88 lines
2.6 KiB
TypeScript
Raw Normal View History

2026-07-29 08:29:29 +00:00
// Module ID: 5521
// Function ID: 5522
2026-07-20 16:05:17 +00:00
// Name: useGetOrFetchApplications
2026-07-29 08:29:29 +00:00
// Dependencies: [19, 4226, 643, 5516, 12, 1351, 589, 2]
// Exports: default, useGetOrFetchApplication
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
// Module 5521 (useGetOrFetchApplications)
import noop from "noop";
import addApplication from "addApplication";
2026-07-20 16:05:17 +00:00
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-29 08:29:29 +00:00
const result = require("shallowEqual").fileFinishedImporting("modules/applications/useGetOrFetchApplications.tsx");
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-07-23 10:11:24 +00:00
let dependencyMap;
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-07-29 08:29:29 +00:00
const items1 = [addApplication];
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;
}
let dependencyMap;
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);
const items3 = [addApplication];
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
};