Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
listen ({commit}) {
const socket = new SockJS('/socket')
const stomp = Stomp.over(socket)
stomp.connect({}, f => {
stomp.subscribe(`/topic/task-instance-error`, d => {
commit(NOTIFY_TASK_ERR, d)
})
}, e => {
console.log(e)
})
},
pollMe ({commit}) {
constructor() {
this.client = over(new SockJS(environment.api));
this.state = new BehaviorSubject(SocketClientState.ATTEMPTING);
this.client.connect({}, () => {
this.state.next(SocketClientState.CONNECTED);
});
}