Description
React websocket listenner
react-websocket alternatives and similar libraries
Based on the "Data Structure" category.
Alternatively, view react-websocket alternatives based on common mentions on social networks and blogs.
-
immutable-js
Immutable persistent data collections for Javascript which increase efficiency and simplicity. -
mori
ClojureScript's persistent data structures and supporting API from the comfort of vanilla JavaScript -
object-path
A tiny JavaScript utility to access deep properties using a path (for Node and the Browser) -
schemapack
Create a schema object to encode/decode your JSON in to a compact byte buffer with no overhead. -
hashmap
HashMap JavaScript class for Node.js and the browser. The keys can be anything and won't be stringified -
omniclone
An isomorphic and configurable javascript utility for objects deep cloning that supports circular references. -
property-path
Get and set object properties using a string path, where you can specify the separator character in the path.
CodeRabbit: AI Code Reviews for Developers

* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of react-websocket or a related project?
README
react-websocket

react-websocket
is a easy-to-use React component for websocket communications.
Help Wanted
Things here are running very slowly as I have a lot of other stuff to take care at the moment so please don't be upset if I don't answer your question or if a PR sits unreviewed for a few days or weeks. Anyone interested in helping it move faster can help by submitting or reviewing PR's and answering each other's questions.
Installing
npm install --save react-websocket
Usage
import React from 'react';
import Websocket from 'react-websocket';
class ProductDetail extends React.Component {
constructor(props) {
super(props);
this.state = {
count: 90
};
}
handleData(data) {
let result = JSON.parse(data);
this.setState({count: this.state.count + result.movement});
}
render() {
return (
<div>
Count: <strong>{this.state.count}</strong>
<Websocket url='ws://localhost:8888/live/product/12345/'
onMessage={this.handleData.bind(this)}/>
</div>
);
}
}
export default ProductDetail;
Properties
url
required The url the websocket connection is listening to.
onMessage
required
The callback called when data is received. Data is JSON.parse
'd
onOpen
The callback called when the connection is successfully opened.
onClose
The callback called when the connection is closed either due to server disconnect or network error.
debug
default: false Set to true to see console logging
reconnect
default: true
accelerated reconnection time
License
*Note that all licence references and agreements mentioned in the react-websocket README section above
are relevant to that project's source code only.