decord/source/lib/AutomaticLifecycleManager.tsx

79 lines
2.1 KiB
TypeScript
Raw Normal View History

2026-08-05 07:35:12 +00:00
// Module ID: 5214
// Function ID: 5215
2026-07-29 08:29:29 +00:00
// Name: initialize
// Dependencies: [709, 2]
2026-07-20 16:05:17 +00:00
2026-08-05 07:35:12 +00:00
// Module 5214 (initialize)
2026-07-29 08:29:29 +00:00
const result = require("set").fileFinishedImporting("lib/AutomaticLifecycleManager.tsx");
class AutomaticLifecycleManager {
constructor() {
obj = Object.create(new.target.prototype);
obj[1] = {};
map = new Map();
obj[2] = map;
return obj;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
}
const prototype = AutomaticLifecycleManager.prototype;
prototype["initialize"] = function initialize() {
const self = this;
this.initializedCount = this.initializedCount + 1;
if (this.initializedCount <= 1) {
self._initialize();
const _Object = Object;
const entries = Object.entries(self.actions);
const item = entries.forEach((arg0) => {
let tmp;
let tmp2;
[tmp, tmp2] = arg0;
let callback = tmp2;
2026-08-04 21:03:28 +00:00
if (typeof tmp2 !== "function") {
2026-07-29 08:29:29 +00:00
callback = tmp2.callback;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const subscription = callback(table[0]).subscribe(tmp, callback);
});
const stores = self.stores;
const item1 = stores.forEach((onChange, addChangeListener) => {
addChangeListener.addChangeListener(onChange);
onChange();
});
}
};
prototype["terminate"] = function terminate(arg0) {
const self = this;
if (this.initializedCount > 0) {
if (arg0) {
self.initializedCount = 0;
} else {
self.initializedCount = self.initializedCount - 1;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (0 === self.initializedCount) {
self._terminate();
const _Object = Object;
const entries = Object.entries(self.actions);
const item = entries.forEach((arg0) => {
let tmp;
let tmp2;
[tmp, tmp2] = arg0;
let callback = tmp2;
2026-08-04 21:03:28 +00:00
if (typeof tmp2 !== "function") {
2026-07-29 08:29:29 +00:00
callback = tmp2.callback;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
callback(table[0]).unsubscribe(tmp, callback);
});
const stores = self.stores;
const item1 = stores.forEach((arg0, removeChangeListener) => {
removeChangeListener.removeChangeListener(arg0);
});
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
}
};
prototype["_initialize"] = function _initialize() {
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
};
prototype["_terminate"] = function _terminate() {
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
};
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default AutomaticLifecycleManager;