Global Feed Post Login
Replying to Avatar MichaelJ

Dang.

Interestingly, I did try putting a `const newValue = value` inside the callback body in your example, and even that didn't work.

It seems like the Svelte compiler should undefine functions in component bodies, to be thorough, since those functions lose their captured context. Then everything in a component would be tied to its lifecycle, not just some things.

Maybe doing that with functions has other problems, though.

Avatar
hodlbod 10mo ago

The problem is that svelte is trying to re-invent garbage collection. It seems to me like you could just... let stuff be defined, and it would disappear when everything that holds a reference to it gets collected.

Reply to this note

Please Login to reply.

Discussion

No replies yet.