twilio-notifications
Advanced tools
Comparing version 0.2.0-alpha.3 to 0.2.0-alpha.4
@@ -67,4 +67,16 @@ 'use strict'; | ||
connectionState: { get: () => this._reliableTransportState.overall ? 'connected' : 'disconnected' }, | ||
connectionState: { get: () => { | ||
if (this._twilsock.state === 'disconnected') { | ||
return 'disconnected'; | ||
} else if (this._twilsock.state === 'disconnecting') { | ||
return 'disconnecting'; | ||
} else if (this._twilsock.state === 'connected' && this._reliableTransportState.registration) { | ||
return 'connected'; | ||
} else if (this._twilsock.state === 'rejected') { | ||
return 'denied'; | ||
} | ||
return 'connecting'; | ||
} }, | ||
updateToken: { value: limit(this._updateToken.bind(this), 1, minTokenRefreshInterval), enumerable: true } | ||
@@ -125,2 +137,3 @@ }); | ||
this.emit('transportReady', overallState); | ||
this.emit('connectionStateChanged', this.connectionState); | ||
} | ||
@@ -199,3 +212,3 @@ }; | ||
/** | ||
* Fired when a Channel's attributes or metadata have been updated. | ||
* Fired when transport state has changed | ||
* @param {boolean} transport state | ||
@@ -205,3 +218,9 @@ * @event NotificationsClient#transportReady | ||
/** | ||
* Fired when transport state has been changed | ||
* @param {string} transport state | ||
* @event NotificationsClient#connectionStateChanged | ||
*/ | ||
module.exports = NotificationsClient; | ||
{ | ||
"name": "twilio-notifications", | ||
"version": "0.2.0-alpha.3", | ||
"version": "0.2.0-alpha.4", | ||
"description": "Client library for Twilio Notifications service", | ||
@@ -5,0 +5,0 @@ "main": "lib/client.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
250316
1273