Closed frederikhors closed 5 years ago
I was wondering about this line of code:
https://github.com/lukeed/svelte-demo/blob/44a94f3c005c0d186ee584b5f125dceac0362b1d/src/components/App.svelte#L43
Is it really useful to have a listener for this?
The onDestroy() method is called when component (App.svelte) is being destroyed, so in this case it never happens, right?
onDestroy()
App.svelte
In the demo, as is, it never happens. But that doesn't mean it never happens in general.
Purposefully showing that the router needs to be detached on exit. Better safe than sorry
I was wondering about this line of code:
https://github.com/lukeed/svelte-demo/blob/44a94f3c005c0d186ee584b5f125dceac0362b1d/src/components/App.svelte#L43
Is it really useful to have a listener for this?
The
onDestroy()
method is called when component (App.svelte
) is being destroyed, so in this case it never happens, right?