import { writable } from 'svelte/store';

export let msgs = writable([]);
export let layout = writable("close");
export let current_room_name = writable("");

export let user;
export let socket;

export function set_user(new_user)     { user = new_user; }
export function set_socket(new_socket) { socket = new_socket; }

export function add_msg(name: string, message: string)
{
	msgs.update(msgs => [...msgs, { name: "me", message: message }]);
}

