File size: 313 Bytes
2bcd13d
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
import { writable } from "svelte/store";
import { browser } from "$app/environment";

// Set the stored value or a sane default.
export const HF_ACCESS_TOKEN = writable(
  (browser && localStorage.HF_ACCESS_TOKEN) || ""
);

if (browser) {
  HF_ACCESS_TOKEN.subscribe((value) => (localStorage.content = value));
}