forked from btford/angular-socket-io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsocket.min.js
15 lines (15 loc) · 1.43 KB
/
socket.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/*
* @license
* ioncube-angular-socket-io v1.0.0
* Forked from angular-socket-io v0.7.0
*
* Changes (c) ionCube Ltd.
* https://www.ioncube.com https:/ioncube24.com
* License: MIT
*
* Original copyright
* (c) 2014 Brian Ford http://briantford.com
* License: MIT
*/
angular.module("btford.socket-io",[]).provider("socketFactory",function(){"use strict";this.$get=["$rootScope","$timeout",function(n,o){var t=function(n,t,e){return t?function(){var r=arguments;o(function(){t.apply(n,r)},0,e!==!1)}:angular.noop};return function(o){o=o||{};var e=o.ioSocket||io.connect(),r=void 0===o.prefix?"socket:":o.prefix,c=o.scope||n,i=function(n,o,r){e.on(n,o.__ng=t(e,o,r))};return{on:i,addListener:i,once:function(n,o,r){e.once(n,o.__ng=t(e,o,r))},emit:function(n,o,r,c){var i=arguments.length-1,r=arguments[i];return"function"==typeof r&&(r=t(e,r,c),arguments[i]=r),e.emit.apply(e,arguments)},removeListener:function(n,o){return o&&o.__ng&&(arguments[1]=o.__ng),e.removeListener.apply(e,arguments)},removeAllListeners:function(){return e.removeAllListeners.apply(e,arguments)},disconnect:function(n){return e.disconnect(n)},connect:function(){return e.connect()},forward:function(n,o,i){n instanceof Array==0&&(n=[n]),o||(o=c),n.forEach(function(n){var c=r+n,u=t(e,function(){Array.prototype.unshift.call(arguments,c),o.$broadcast.apply(o,arguments)},i);o.$on("$destroy",function(){e.removeListener(n,u)}),e.on(n,u)})}}}}]});
//# sourceMappingURL=socket.min.js.map