Resettable
The resettable store is an extended svelte writable store that can be reset to its initial value through store.reset()
. It works on any values including objects.
<script>
import { resettable } from 'svu/store';
const store = resettable(100);
</script>
<input type="range" min="0" max="100" step="1" bind:value={$store} />
<button on:click={store.reset}>Reset</button>