2.2.0 • Published 9 years ago
ctrl-react-web-socket v2.2.0
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-socketUsage
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