summaryrefslogtreecommitdiff
path: root/frontend
diff options
context:
space:
mode:
Diffstat (limited to 'frontend')
-rw-r--r--frontend/src/utils/websocket.js12
1 files changed, 3 insertions, 9 deletions
diff --git a/frontend/src/utils/websocket.js b/frontend/src/utils/websocket.js
index 6db91899..4a07d532 100644
--- a/frontend/src/utils/websocket.js
+++ b/frontend/src/utils/websocket.js
@@ -9,20 +9,14 @@ export const createWsConnection = (headers = {}) =>
let socket = Stomp.over(new SockJS(wsURL), {
debug: process.env.NODE_ENV !== "production"
});
- socket.connect(
- headers,
- frame => {
- return resolve({ frame, socket });
- },
- reject
- );
+ socket.connect(headers, frame => resolve({ frame, socket }), reject);
});
export const createSubscriptionChannel = (socket, path) => {
return eventChannel(emitter => {
- const receiveUsernameHandler = socket.subscribe(path, event => {
+ const socketSubscription = socket.subscribe(path, event => {
emitter(JSON.parse(event.body));
});
- return () => receiveUsernameHandler.unsubscribe();
+ return () => socketSubscription.unsubscribe();
});
};
bgstack15