At what point does a Lightning component get destroyed ? More specifically we have been modelling "page" to "page" navigation using navigateToComponent events but it appears that old components we have navigated away from are still receiving events. Is there a more appropriate event or approach ?
Also, are there any events which inform a component that it is about to be destroyed ? I know the components renderer has an unrender method which is called when the component gets destroyed but is there anyway to detect component destruction without proving a custom renderer ?
We're looking for ways that we might clean up other JS resources associated with components.