Socialify

Folder ..

Viewing store.ts
13 lines (9 loc) • 360.0 B

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
import { writable } from 'svelte/store';
import { browser } from "$app/environment"

export const notFound = writable(false);
export const ready = writable(false);

const nf = browser && localStorage.getItem('nf') === 'true';


notFound.subscribe((value) => {
    if (browser) return localStorage.setItem('nf', value.toString());
});

nf && notFound.set(true);