text: export default class SocketApi {
      constructor(url){
          this.socket = new WebSocket(url);
      }
  
      set onopen(cb) {
          this.socket.onopen = cb;
      }
  
      set onerror(cb) {
          this.socket.onerror = cb;
      }
  
      set onmessage(cb) {
          this.socket.onmessage = cb;
      }
  
      send(message) {
          this.socket.send(message);
      }
  
      close() {
          this.socket.close();
      }
  }