Fixed codacy problems in forms/base/services/socket.io.client.js

This commit is contained in:
David Baldwynn 2017-04-22 19:15:53 -07:00 committed by GitHub
parent e8edee2e2d
commit 35f0290a2f

View file

@ -1,14 +1,11 @@
(function () {
'use strict';
// Create the Socket.io wrapper service
angular
.module('forms')
.factory('Socket', Socket);
Socket.$inject = ['$timeout', '$window'];
function Socket($timeout, $window) {
var service;
// Connect to Socket.io server
function connect(url) {
service.socket = io(url, {'transports': ['websocket', 'polling']});
@ -39,7 +36,7 @@
}
}
var service = {
service = {
connect: connect,
emit: emit,
on: on,
@ -61,4 +58,11 @@
return service;
}
// Create the Socket.io wrapper service
angular.module('forms')
.factory('Socket', Socket);
Socket.$inject = ['$timeout', '$window'];
}());