Closed HappyStriker closed 6 months ago
They should get GC'd just fine.
That being said, you'd avoid any extra GC work by using useComputed
in the render function. As it is, time
has to be recreated on every rerender.
They should get GC'd just fine.
That being said, you'd avoid any extra GC work by using
useComputed
in the render function. As it is,time
has to be recreated on every rerender.
Thank you very much for the explanation.
Hello,
I have a quick question about the garbage collection of signals, more specifically of the
computed
type. Lets look at the following code, which should use the signaltime
directly instead oftime.value
in therender
method, but it is just a simplification for the demonstration:The class method
render
gets called every second in order to do get the latest vdom of the component. But what happens to the previoustime
signals? Do they automatically get garbage collected or is it my job as developer to clean up those signals to prevent any memory leaks?Thanks for the clarification!