ctrl-react-web-socket
v2.2.0
Published
A React component that abstracts around socket.io-client.
Downloads
5
Maintainers
Readme
ctrl-react-web-socket
A React component that abstracts around socket.io-client.
Installation
Yarn is recommended for installation.
$ yarn add --dev ctrl-react-web-socket
$ npm install --save-dev ctrl-react-web-socket
Usage
import {WebSocketClient} from 'ctrl-react-web-socket'
import ReactDOM from 'react-dom'
import App from './App.jsx'
ReactDOM.render(
<WebSocketClient url='http://localhost:8080'>
<App/>
</WebSocketClient>
, document.querySelector('#container')
)
App
will inherit a property called webSocket
that contains an emit
method
and an isConnected
state.
Methods
Full documentation to come soon!
License
Copyright (c) 2016 Martin Experiments LLC
MIT (https://www.opensource.org/licenses/MIT)