This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { browser } from '$app/environment' | |
| export type PersistentStore<T> = ReturnType<typeof newPersistentStore<T>> | |
| export function newPersistentStore<T>(key: string, initial: T) { | |
| let value = $state<T>(initial) | |
| let mounted = $state(false) | |
| const storeName = `Persistent store '${key}'` | |
| function mount() { |