-
Notifications
You must be signed in to change notification settings - Fork 0
/
_store.js
45 lines (30 loc) · 859 Bytes
/
_store.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import { writable } from 'svelte/store';
import { browser } from '$app/env';
export const isHost = writable(false);
export const code = writable('');
let existingRecovery = ''
if (browser) existingRecovery = localStorage.getItem('recovery') || ''
export const recovery = writable(existingRecovery);
recovery.subscribe(secret => {
if (browser) localStorage.setItem('recovery', secret);
});
export const nickname = writable('')
export const hand = writable({});
export const players = writable([]);
export const discard = writable({});
export const focused = writable({
location: '',
cardIndex: '',
});
export const state = writable('profile');
export const overlay = writable({
show: false,
closable: true,
style: '',
message: '',
});
export const gamePage = writable({
page: '',
color: '',
});
export const log = writable([]);