Skip to main content

clearTemporaryMode

Clears the temporary override and reverts to the persisted or system mode.

clearTemporaryMode removes any temporary mode set via setMode(..., { temporaryOnly: true }).

After calling this, the active mode falls back to the user's persisted preference (from localStorage) or to the system preference if none is set.

Usage

		<script lang="ts">
	import { clearTemporaryMode } from "mode-watcher";
</script>
 
<button onclick={clearTemporaryMode}>Use persisted/system preference</button>
	

See also