'use strict' ; import { app } from '../../config/config' ; export const socket = angular . module ( 'teambition' ) . factory ( 'socket' , [ 'ngConsumer' , ( ngConsumer ) => { return ( token ) => { let ws = ngConsumer . connect ( app . wsHost , { path : '/websocket' , token : token } ) ; ws . on = ( eventName , callback ? ) => { return ngConsumer . onmessage ( eventName , callback ) ; } ; return ws ; } ; } ] ) ;