feat: remove state preservation

This commit is contained in:
2025-09-19 21:12:15 +02:00
parent 262b03413a
commit 0aca182de9
6 changed files with 38 additions and 46 deletions

View File

@@ -225,10 +225,7 @@ class ViewModel {
// Batch update with change detection
batchUpdate(updates, options = {}) {
const { preserveUIState = true, notifyChanges = true } = options;
// Optionally preserve UI state snapshot
const currentUIState = preserveUIState ? new Map(this._uiState) : null;
const { notifyChanges = true } = options;
// Track which keys actually change and what the previous values were
const changedKeys = [];
@@ -245,11 +242,6 @@ class ViewModel {
}
});
// Restore UI state if requested
if (preserveUIState && currentUIState) {
this._uiState = currentUIState;
}
// Notify listeners for changed keys
if (notifyChanges) {
changedKeys.forEach(key => {
@@ -259,7 +251,7 @@ class ViewModel {
}
}
// Base Component class with enhanced state preservation
// Base Component class
class Component {
constructor(container, viewModel, eventBus) {
this.container = container;