Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
connectStompService(config: any) {
const stompUrl = config.protocol + '://' + config.host + ':' + config.port + config.endpoint;
const stompConfig: StompConfig = {
url: stompUrl,
headers: {
login: '',
passcode: ''
},
heartbeat_in: 0,
heartbeat_out: 20000,
reconnect_delay: 5000,
debug: true
};
this.stompService = new StompService(stompConfig);
this.stompService.subscribe(config.likesTopic).subscribe(like => this.likes.unshift(JSON.parse(like.body)));
}