A quick demonstration of using the State: Overview page in Kitten’s¹ settings while developing to keep an eye on your event and event listener counts to avoid memory leaks.
Notice how the events and listeners counts change as I navigate between the People and Settings pages in my Place² node and that they are consistent. If they were rising as I navigated back and forth I’d know I had a memory leak somewhre.
If you use Kitten’s built-in features (e.g., the `addEventHandler()` method on your `kitten.Component` subclasses, Kitten will handler adding and removing listeners for you automatically during your component’s lifecycle. You can also do so manually using your component’s automatically-called `onConnect()` and `onDisconnect()` event handlers.
This view is useful during development to ensure you don’t have any memory leaks as pages are loaded and unloaded.
¹ https://kitten.small-web.org
² Place is in early development at the moment (https://codeberg.org/place/app)
#Kitten #SmallWeb #SmallTech #demo #developerExperience #developerTools #design #eventModel #events #memory #memoryLeaks #observerPattern #listeners #web #dev #HTML #CSS #JavaScript #NodeJS #server #platform #framework #WebSockets #hypermedia #htmx #StreamingHTML #place #peerToPeer #peerToPeerWeb