]>
Commit | Line | Data |
---|---|---|
1 | import { writable } from 'svelte/store'; | |
2 | ||
3 | const internals = {}; | |
4 | ||
5 | internals.forums = [ | |
6 | { | |
7 | id: 'life', | |
8 | kanji: '命', | |
9 | label: 'Life' | |
10 | }, | |
11 | { | |
12 | id: 'the-world', | |
13 | kanji: '世', | |
14 | label: 'The World' | |
15 | }, | |
16 | { | |
17 | id: 'online', | |
18 | kanji: '直結', | |
19 | label: 'Online' | |
20 | }, | |
21 | { | |
22 | id: 'experience', | |
23 | kanji: '体験', | |
24 | label: 'Experience' | |
25 | }, | |
26 | { | |
27 | id: 'belief', | |
28 | kanji: '信念', | |
29 | label: 'Belief' | |
30 | }, | |
31 | { | |
32 | id: 'movement', | |
33 | kanji: '動', | |
34 | label: 'Movement' | |
35 | }, | |
36 | { | |
37 | id: 'emotion', | |
38 | kanji: '情', | |
39 | label: 'Emotion' | |
40 | }, | |
41 | { | |
42 | id: 'interaction', | |
43 | kanji: '交流', | |
44 | label: 'Interaction' | |
45 | }, | |
46 | { | |
47 | id: 'structure', | |
48 | kanji: '構造', | |
49 | label: 'Structure' | |
50 | }, | |
51 | { | |
52 | id: 'sound', | |
53 | kanji: '音', | |
54 | label: 'Sound' | |
55 | }, | |
56 | { | |
57 | id: 'words', | |
58 | kanji: '言葉', | |
59 | label: 'Words' | |
60 | }, | |
61 | { | |
62 | id: 'us', | |
63 | kanji: '一同', | |
64 | label: 'Us' | |
65 | }, | |
66 | { | |
67 | id: 'everything', | |
68 | kanji: '何事も', | |
69 | label: 'Everything' | |
70 | } | |
71 | ]; | |
72 | ||
73 | export const forums = writable(internals.forums); | |
74 | ||
75 | export function addForum() { | |
76 | const id = Math.random(); | |
77 | ||
78 | forums.update((forums) => ([...forums, | |
79 | { | |
80 | id, | |
81 | kanji: 'の', | |
82 | label: `Woah ${id}` | |
83 | } | |
84 | ])); | |
85 | }; |