How to use the sockjs-client.CLOSING function in sockjs-client

To help you get started, we’ve selected a few sockjs-client examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Coding / WebIDE-Frontend / app / dashboard / api / socket.js View on Github external
const error = (frame) => {
            switch (this.ws.readyState) {
                case SockJS.CLOSING:
                case SockJS.CLOSED:
                    this.reconnect();
                    break;
                case SockJS.OPEN:
                default:
                    console.log('FRAME ERROR', frame);
                    this.errorCallback(frame);
            }
        };
        const headers = this.headers || {};
github Coding / WebIDE-Frontend / app / backendAPI / websocketClients.js View on Github external
const error = (frame) => {
      log('fsSocket error', this.socket)
      switch (this.socket.readyState) {
        case SockJS.CLOSING:
        case SockJS.CLOSED:
          runInAction(() => config.fsSocketConnected = false)
          this.reconnect()
          break
        case SockJS.OPEN:
          log('FRAME ERROR', frame)
          break
        default:
      }
      this.errorCallback(frame)
    }

sockjs-client

SockJS-client is a browser JavaScript library that provides a WebSocket-like object.

MIT
Latest version published 2 years ago

Package Health Score

84 / 100
Full package analysis