API Reference

themeLocalStorageKey

The key used to store the theme in local storage.

The key used to store the theme in local storage.

Usage

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

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

© 2024 Svecosystem Team