How to use the network/actions.NetActions.disconnect function in network

To help you get started, we’ve selected a few network 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 samuelmaddock / metastream / packages / metastream-app / src / containers / LobbyPage.tsx View on Github external
private closeLobby() {
    this.setState({ connected: false })

    if (this.server) {
      this.server.removeListener('close', this.disconnect)
      this.server = undefined
    }

    if (this.tabObserver) {
      this.tabObserver.destroy()
      this.tabObserver = undefined
    }

    PlatformService.get().leaveLobby(this.lobbyId)
    this.props.dispatch(NetActions.disconnect({ host: this.host }))
  }