Skip to content

Commit

Permalink
feat(websockets): Add ability to reconnect (#3006)
Browse files Browse the repository at this point in the history
feat(websockets): Add ability to reconnect
  • Loading branch information
artsy-peril[bot] authored Nov 10, 2021
2 parents 82624a2 + ec86ccf commit 53a7b75
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/client/apps/websocket/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import { messageTypes } from "./messageTypes"
let socket

const init = (store, rootURL) => {
socket = io(rootURL)
socket = io(rootURL, {
reconnection: true,
})

// add listeners to socket messages so we can re-dispatch them as actions
Object.keys(messageTypes).forEach(key =>
socket.on(key, data => {
Expand Down

0 comments on commit 53a7b75

Please sign in to comment.