Skip to content

rodrigoramosrs/global-websocket-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Global Sigleton Websocket Client for React JS

NuGet version

Installation

npm i global-websocket-client

Usage Example

import React, { Component } from "react";
import WebSocketClient from "../../src";

class Demo extends Component {
  state = {
    WebSocketUri: 'wss://echo.websocket.org'
  };

  componentDidMount(){
    WebSocketClient.connect(
      this.state.WebSocketUri,
      this.openCallback,
      this.onErrorCallback,
      this.onMessageCallback,
      this.onCloseCallback
    );
  };
  render() {
    return (
      <div>
        <h1>global-websocket-client</h1>
      </div>
    );
  }
}

About

Global Sigleton Websocket Client for React JS

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published