From 8e27a90559a0d16b6512b34eda906b76586c1aff Mon Sep 17 00:00:00 2001 From: arzhed Date: Thu, 16 Jun 2016 01:49:01 +0200 Subject: [PATCH 1/2] "isConnected" function to replace "connected" status --- socket.js | 4 ++++ socket.min.js | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/socket.js b/socket.js index 649c416..bf57c09 100644 --- a/socket.js +++ b/socket.js @@ -74,6 +74,10 @@ angular.module('btford.socket-io', []). return socket.connect(); }, + isConnected: function() { + return socket.connected; + }, + // when socket.on('someEvent', fn (data) { ... }), // call scope.$broadcast('someEvent', data) forward: function (events, scope) { diff --git a/socket.min.js b/socket.min.js index 7c90e6b..c4f8a07 100644 --- a/socket.min.js +++ b/socket.min.js @@ -4,5 +4,5 @@ * (c) 2014 Brian Ford http://briantford.com * License: MIT */ -angular.module("btford.socket-io",[]).provider("socketFactory",function(){"use strict";var n="socket:";this.$get=["$rootScope","$timeout",function(t,e){var r=function(n,t){return t?function(){var r=arguments;e(function(){t.apply(n,r)},0)}:angular.noop};return function(e){e=e||{};var o=e.ioSocket||io.connect(),c=void 0===e.prefix?n:e.prefix,u=e.scope||t,i=function(n,t){o.on(n,t.__ng=r(o,t))},a=function(n,t){o.once(n,t.__ng=r(o,t))},s={on:i,addListener:i,once:a,emit:function(n,t,e){var c=arguments.length-1,e=arguments[c];return"function"==typeof e&&(e=r(o,e),arguments[c]=e),o.emit.apply(o,arguments)},removeListener:function(n,t){return t&&t.__ng&&(arguments[1]=t.__ng),o.removeListener.apply(o,arguments)},removeAllListeners:function(){return o.removeAllListeners.apply(o,arguments)},disconnect:function(n){return o.disconnect(n)},connect:function(){return o.connect()},forward:function(n,t){n instanceof Array==!1&&(n=[n]),t||(t=u),n.forEach(function(n){var e=c+n,u=r(o,function(){Array.prototype.unshift.call(arguments,e),t.$broadcast.apply(t,arguments)});t.$on("$destroy",function(){o.removeListener(n,u)}),o.on(n,u)})}};return s}}]}); -//# sourceMappingURL=socket.min.js.map \ No newline at end of file +angular.module("btford.socket-io",[]).provider("socketFactory",function(){"use strict";var n="socket:";this.$get=["$rootScope","$timeout",function(t,e){var r=function(n,t){return t?function(){var r=arguments;e(function(){t.apply(n,r)},0)}:angular.noop};return function(e){e=e||{};var o=e.ioSocket||io.connect(),c=void 0===e.prefix?n:e.prefix,u=e.scope||t,i=function(n,t){o.on(n,t.__ng=r(o,t))},a=function(n,t){o.once(n,t.__ng=r(o,t))},s={on:i,addListener:i,once:a,emit:function(n,t,e){var c=arguments.length-1,e=arguments[c];return"function"==typeof e&&(e=r(o,e),arguments[c]=e),o.emit.apply(o,arguments)},removeListener:function(n,t){return t&&t.__ng&&(arguments[1]=t.__ng),o.removeListener.apply(o,arguments)},removeAllListeners:function(){return o.removeAllListeners.apply(o,arguments)},disconnect:function(n){return o.disconnect(n)},connect:function(){return o.connect()},isConnected:function(){return o.connected;},forward:function(n,t){n instanceof Array==!1&&(n=[n]),t||(t=u),n.forEach(function(n){var e=c+n,u=r(o,function(){Array.prototype.unshift.call(arguments,e),t.$broadcast.apply(t,arguments)});t.$on("$destroy",function(){o.removeListener(n,u)}),o.on(n,u)})}};return s}}]}); +//# sourceMappingURL=socket.min.js.map From ab35a8717eedbe5daafa7b439c6e84b8a1ed7fec Mon Sep 17 00:00:00 2001 From: arzhed Date: Thu, 16 Jun 2016 02:23:38 +0200 Subject: [PATCH 2/2] bower.json update --- bower.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bower.json b/bower.json index 4948b18..39cc228 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { - "name": "angular-socket-io", - "version": "0.7.0", + "name": "angular-socket-io-arzhed", + "version": "0.7.1", "main": "socket.js", "dependencies": { "angular": "^1.2.6"