News for hackers. Stuff that matters.
Re:Building a web app with no framework by LAC-Tech on Saturday March 05, 2022 @11:25PM (#30575020)
Yeah that's an interesting problem. I mean the simple answer is you just make an unsubscribe method. But that doesn't solve the layer of adding and removing subscription handlers.
Re:Building a web app with no framework by mark_and_sweep on Tuesday March 08, 2022 @11:33AM (#30601858)
Using a subtree, childlist MutationObserver, you can implement a disconnectedCallback for non-custom elements. In the callback, you can clean-up any event handlers that you have added to the element yourself.
Re:Building a web app with no framework by naasking on Sunday March 06, 2022 @12:41AM (#30575320)
The simple answer from FrTime is to use weak references.