Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
initializeWebSocketConnection() {
this.closeWebSocket();
const ws = new SockJS(this.serverUrl);
this.stompClient = Stomp.over(ws);
const that = this;
this.stompClient.connect({}, function(frame) {
this.chatStomp = that.stompClient.subscribe('/chat', message => {
const eventUserDto: EventUserDto = JSON.parse(message.body);
that.eventService.addEvent(eventUserDto);
});
});
}