Add type annocations, change hostName to isHost, add players list and type

This commit is contained in:
Oliver-Akins 2021-12-24 03:21:31 -07:00
parent 0fb2d986a9
commit 6dc0ed2ab5

View file

@ -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" },
]);