Notice when leaving a component



anyone have an elegant solution to know when a component is exited? in order to do some conditional cleanup. Specially when routing logic matches a global intent in another component

I think event middleware could do it but coding is required for that case

Also, I would like that logic to go inside the “leaving” component. So I can still access component data etc.

Something like “ON_LEAVE()”.

Am I missing something? Does it seems reasonable for you?