API Reference

localStorageKey

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 localStorageKey like so:

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

© 2024 Svecosystem Team