]>
git.r.bdr.sh - rbdr/forum/blob - app/socket_coordinator.js
d6768acb1943d5703d28103b8a7525a22fbdb6e6
1 import { socketServer
} from './config/config';
5 socket: null, // stores the socket connection
9 internals
.socket
= new WebSocket(socketServer
);
13 export const onMessage = function (listener
) {
15 if (!internals
.socket
) {
19 internals
.socket
.addEventListener('message', (message
) => {
21 listener(JSON
.parse(message
.data
));