willDestroy Hook in route never gets invoked

I’m using willDestroy Hook to detach event listeners in my application route. It never gets invoked however. Am I missing something?

In the normal course of running your app, the application route is never destroyed. It’s the top-most route. Destroying it implies you won’t be running your app anymore, which is not a thing people generally do. Just navigating away or closing the tab is the same thing.

But you will see it being destroyed (and willDestroy will run) within your test suite, since that does create and destroy the whole application for each acceptance test.

1 Like