Rich-Harris/svelte-cubed

Example page options (svelte-knobby) stays with you even after leaving example page.

BenLebich opened this issue · 2 comments

+1 on mobile too

To fix this, we just need to add an onDestroy call on the components that use this. Something like:

<script>
	import { onMount, onDestroy } from 'svelte';
	import * as THREE from 'three';
	import * as SC from 'svelte-cubed';
	import * as knobby from 'svelte-knobby';

        ...

	onDestroy(() => {
		knobby.toggle(false);
	});
</script>