Skip to content

Commit

Permalink
Add public isConnecting and mightBeAboutToAutoConnect methods
Browse files Browse the repository at this point in the history
  • Loading branch information
sgress454 committed Oct 28, 2016
1 parent e06abd1 commit fd962bb
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions sails.io.js
Original file line number Diff line number Diff line change
Expand Up @@ -951,9 +951,8 @@
/**
* isConnected
*
* @api private
* @return {Boolean} whether the socket is connected and able to
* communicate w/ the server.
* communicate w/ the server.
*/

SailsSocket.prototype.isConnected = function () {
Expand All @@ -965,6 +964,28 @@
};


/**
* isConnecting
*
* @return {Boolean} whether the socket is in the process of connecting
* to the server.
*/

SailsSocket.prototype.isConnecting = function () {
return this.isConnecting;
};

/**
* isConnecting
*
* @return {Boolean} flag that is `true` after a SailsSocket instance is
* initialized but before one tick of the event loop
* has passed (so that it hasn't attempted to connect
* yet, if autoConnect ends up being configured `true`)
*/
SailsSocket.prototype.mightBeAboutToAutoConnect = function() {
return this.mightBeAboutToAutoConnect;
};

/**
* [replay description]
Expand Down

0 comments on commit fd962bb

Please sign in to comment.