Add type annocations, change hostName to isHost, add players list and type
This commit is contained in:
parent
0fb2d986a9
commit
6dc0ed2ab5
1 changed files with 17 additions and 4 deletions
|
|
@ -1,5 +1,18 @@
|
||||||
import { writable } from "svelte/store";
|
import { writable, readable } from "svelte/store";
|
||||||
|
|
||||||
export const state = writable("main-menu");
|
export const state = writable<string>("main-menu");
|
||||||
export const myName = writable();
|
export const myName = writable<string>();
|
||||||
export const hostName = writable();
|
export const isHost = writable<boolean>(true);
|
||||||
|
|
||||||
|
|
||||||
|
interface Player {
|
||||||
|
name: string;
|
||||||
|
host: boolean;
|
||||||
|
colour: string;
|
||||||
|
}
|
||||||
|
export const players = readable<Player[]>([
|
||||||
|
{ name: `Player 1`, host: true, colour: "#00aa00" },
|
||||||
|
{ name: `Player 2`, host: false, colour: "#aaaa00" },
|
||||||
|
{ name: `Player 3`, host: false, colour: "#00aaaa" },
|
||||||
|
{ name: `Player 4`, host: false, colour: "#ffaaff" },
|
||||||
|
]);
|
||||||
Loading…
Add table
Add a link
Reference in a new issue