reduce memory usage - avoid deep copy

This commit is contained in:
Smartsheet-JB-Brown 2025-04-17 19:23:29 -07:00
parent a2d7f19418
commit b7f45f7870

View file

@ -86,13 +86,11 @@ export class PackageManagerViewStateManager {
}
public getState(): ViewState {
// Create a deep copy to ensure React sees changes
return JSON.parse(JSON.stringify(this.state))
return { ...this.state }
}
private notifyStateChange(): void {
// Create a deep copy to ensure React sees changes
const newState = JSON.parse(JSON.stringify(this.state))
const newState = { ...this.state }
this.stateChangeHandlers.forEach((handler) => {
handler(newState)