I have a component with a signal state:
array: WritableSignal<string[]> = signal([]);
I want the array to be removed from browser memory because the array can get quite big, and the component may be removed from view and then added again.
I have checked the browser memory tab, there is a new instance of the component every time it is shown in view, and they are all stored.
I want the behavior where the component is destroyed and it’s removed from browser memory.
Jordan Ivanov is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
2