This commit is contained in:
janisslsm committed 2026-11-01 12:12:55 +02:00
1 parent 1781d25a15
commit 732c0ad767
33051 files changed
+2591613 -3019689

No files matched your search

+63
View File
@@ -0,0 +1,63 @@
// Metro module 12732 (f12733).
import isUndefinedOrNull from "../_bundle/isUndefinedOrNull";
class StateManager {
constructor(alwaysUpdateState = true) {
const r5 = {
__proto__: new.target.prototype,
dirty: false
};
r5.state = r5.getInitialState();
r5.alwaysUpdateState = alwaysUpdateState;
return r5;
}
shouldCommit() {
return true;
}
setState(a0) {
this.state = {
...this.state,
...a0
};
}
getState() {
return this.state;
}
reset() {
this.dirty = false;
this.state = this.getInitialState();
}
update(r7 = {}, r2 = false) {
const nextState = this.getNextState({
...this.state,
...r7
});
if (r2) {
this.dirty = !isUndefinedOrNull(nextState, this.getInitialState());
} else {
for (const item of Object.keys(nextState)) {
let dirty = this.dirty;
if (!dirty) {
const state = this.state;
dirty = !isUndefinedOrNull(state[item], nextState[item]);
}
this.dirty = dirty;
}
}
const r55 = this.dirty && this.shouldCommit();
if (r55 || this.alwaysUpdateState) {
this.state = nextState;
}
let r59 = !!r55;
if (r59) {
this.dirty = false;
this.didCommit(this.state);
r59 = true;
}
return r59;
}
forceUpdate() {
this.dirty = false;
this.didCommit(this.state);
}
}
export default StateManager;