import { user, msgs } from './Store_chat';

export function socket_events(socket)
{
	socket.on('message', function(from, message)
	{
		console.log("received msg:", message, from);
		if (from === user.username)
			from = "me";
		msgs.update(msgs => [...msgs, { name: from, message: message }]);
	});
}
