API Reference

modeStorageKey

The key used to store the mode in local storage.

The key used to store the mode in local storage.

Usage

If you wanted to clear the history of the user's mode preference, you could use the modeStorageKey like so:

	<script lang="ts">
	import { modeStorageKey } from "mode-watcher";
 
	function clearModeFromLocalStorage() {
		localStorage.removeItem($modeStorageKey);
	}
</script>
 
<p>Clear the user's mode preference history.</p>
<button on:click={clearModeFromLocalStorage}>Clear</button>	
MIT

© 2024 Svecosystem Team