class WebsocketClient {
    constructor(onNewEffects) {
        this.socket = new WebSocket("ws://localhost:5000");
        this.socket.addEventListener("open", (event)  => {
            this.socket.send("connected");
        });
        this.socket.addEventListener("message", (event) => {
            let msg = JSON.parse(event.data);
            if (msg.type == "effects") {
                onNewEffects(msg.effects);
            }
        });
    }
}