This was causing problems with Jest even though it was otherwise fine.
In Svelte the component updates/unmount happen in a different order than in React. The `mounted` guard doesn't work in Svelte and needs a different approach.