Hi again,
I have some state in JS for a particular page. That state changes whilst the user is using the page so if the user navigates away from the page I want to reset the JS state. Something like this (in pseudo code):
Handling the JS state manually is the right way to go, since you should always have full control over it. If you’re up to resetting the “state” from a JS function, then your pseudo code is pretty close. Here’s actual Fuse code for the same thing: