Basically, when users navigate through my web app using /#/blah/blah, I want an event listener that listens to when someone has “left” a page, and gone on to another page.
When someone leaves a page, I want to know, so I can destroy the instances of stuff I’ve created.
You might be interested in this related question, and my answer there might be helpful. Essentially, the answer is no, there isn’t any
"exit"event; you’d have to listen for new"route:<some-route>"events. There isn’t a generic"route"event, but you could bind to all router events (I think, by default, these should all be routes), possibly checking the route name in the event to make sure it’s appropriate to destroy existing instances, something like: