DEV Community

Discussion on: Using WebSockets with React.js, the right way (no library needed)

Collapse
 
dtobias profile image
Dom • Edited

I made a hook inspired by GraphQL in the format const { data, loading, error } = useSubscription(url) and it also shares the same websocket if it's already open and retries (exponential back off) if the connection closes abnormally.