Files
discord-decomp/_bundle/Module1704.js
T
2026-11-01 12:12:55 +02:00

59 lines
1.9 KiB
JavaScript

// Metro module 1704 (f1705).
import { makeMutable } from "./Module1650";
const __initData = {
code: "function pnpm_ViewDescriptorsSetTs1(descriptors){const{item,updater}=this.__closure;var _updater;const index=descriptors.findIndex(function(descriptor){return descriptor.tag===item.tag;});if(index!==-1){descriptors[index]=item;}else{descriptors.push(item);}(_updater=updater)===null||_updater===void 0||_updater(true);return descriptors;}"
};
const __initData2 = {
code: "function pnpm_ViewDescriptorsSetTs2(descriptors){const{viewTag}=this.__closure;const index=descriptors.findIndex(function(descriptor){return descriptor.tag===viewTag;});if(index!==-1){descriptors.splice(index,1);}return descriptors;}"
};
export function makeViewDescriptorsSet() {
const shareableViewDescriptors = makeMutable([]);
let c13171_0 = shareableViewDescriptors;
let c13171_1 = new Set();
return {
shareableViewDescriptors,
add: (a0, a1) => {
let c24556_0 = a0;
c13171_1.add(a0.tag);
const current = a1?.current;
const u = function u(a0) {
const r8 = a0.findIndex((item) => item.tag === c24556_0.tag);
if (r8 !== -1) {
a0[r8] = c24556_0;
} else {
a0.push(c24556_0);
}
if (current != null) {
current(true);
}
return a0;
};
u.__closure = {
item: a0,
updater: current
};
u.__workletHash = 1368679644593;
u.__initData = __initData;
c13171_0.modify(u, false);
},
remove: (a0) => {
let c24557_0 = a0;
c13171_1.delete(a0);
const c = function c(a0) {
const r5 = a0.findIndex((item) => item.tag === c24557_0);
if (r5 !== -1) {
a0.splice(r5, 1);
}
return a0;
};
c.__closure = {
viewTag: a0
};
c.__workletHash = 5508648561577;
c.__initData = __initData2;
c13171_0.modify(c, false);
},
has: (a0) => c13171_1.has(a0)
};
}