decord/source/modules/emoji_terms/LazyPromiseInitializer.tsx

52 lines
1.2 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 6772
// Function ID: 6773
2026-07-29 08:29:29 +00:00
// Name: setParams
// Dependencies: [2]
2026-07-20 16:05:17 +00:00
2026-08-24 06:08:38 +00:00
// Module 6772 (setParams)
import set from "set" /* 2 */;
const result = set.fileFinishedImporting("modules/emoji_terms/LazyPromiseInitializer.tsx");
2026-07-29 08:29:29 +00:00
class LazyPromiseInitializer {
constructor(arg0) {
obj = Object.create(new.target.prototype);
obj.loader = global;
return obj;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
}
const prototype = LazyPromiseInitializer.prototype;
prototype["setParams"] = function setParams(param) {
const self = this;
if (this.param !== param) {
self.param = param;
self.loading = false;
self.loaded = false;
}
};
prototype["get"] = function get() {
this.ensureLoaded();
return this.val;
};
prototype["ensureLoaded"] = function ensureLoaded() {
let self = this;
self = this;
if (!this.loaded) {
if (!self.loading) {
if (undefined !== self.param) {
const param = self.param;
self.loading = true;
self.loader(param).then((arg0) => {
if (param === self.param) {
tmp.val = arg0;
tmp.loading = false;
tmp.loaded = true;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
});
const loaderResult = self.loader(param);
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
}
};
2026-07-23 10:11:24 +00:00
2026-07-29 08:29:29 +00:00
export default LazyPromiseInitializer;