by doradoblank · 1y ago · 0 comments
One really easy way is to put a custom element at the root of the dom and just add/remove event listeners, maybe one-shot if that's all you need.
I also have a convenient little library called ApplicationState [1], which basically does the same thing but can persist state in indexdb.
Lots of other libraries out there too.