phoenix-socket
Advanced tools
Comparing version 1.1.0 to 1.1.3
@@ -54,4 +54,5 @@ "use strict"; | ||
// | ||
// Joining a channel with `channel.join(topic, params)`, binds the params to | ||
// `channel.params`. Subsequent rejoins will send up the modified params for | ||
// Creating a channel with `socket.channel(topic, params)`, binds the params to | ||
// `channel.params`, which are sent up on `channel.join()`. | ||
// Subsequent rejoins will send up the modified params for | ||
// updating authorization params, or passing up last_message_id information. | ||
@@ -68,3 +69,3 @@ // Successful joins receive an "ok" status, while unsuccessful joins | ||
// `receive("timeout", callback)` to abort waiting for our other `receive` hooks | ||
// and take action after some period of waiting. | ||
// and take action after some period of waiting. The default timeout is 5000ms. | ||
// | ||
@@ -283,3 +284,3 @@ // | ||
_this2.state = CHANNEL_STATES.errored; | ||
_this2.rejoinTimer.setTimeout(); | ||
_this2.rejoinTimer.scheduleTimeout(); | ||
}); | ||
@@ -293,3 +294,3 @@ this.joinPush.receive("timeout", function () { | ||
_this2.state = CHANNEL_STATES.errored; | ||
_this2.rejoinTimer.setTimeout(); | ||
_this2.rejoinTimer.scheduleTimeout(); | ||
}); | ||
@@ -304,3 +305,3 @@ this.on(CHANNEL_EVENTS.reply, function (payload, ref) { | ||
value: function rejoinUntilConnected() { | ||
this.rejoinTimer.setTimeout(); | ||
this.rejoinTimer.scheduleTimeout(); | ||
if (this.socket.isConnected()) { | ||
@@ -638,3 +639,3 @@ this.rejoin(); | ||
clearInterval(this.heartbeatTimer); | ||
this.reconnectTimer.setTimeout(); | ||
this.reconnectTimer.scheduleTimeout(); | ||
this.stateChangeCallbacks.close.forEach(function (callback) { | ||
@@ -987,6 +988,6 @@ return callback(event); | ||
// }) | ||
// reconnectTimer.setTimeout() // fires after 1000 | ||
// reconnectTimer.setTimeout() // fires after 5000 | ||
// reconnectTimer.scheduleTimeout() // fires after 1000 | ||
// reconnectTimer.scheduleTimeout() // fires after 5000 | ||
// reconnectTimer.reset() | ||
// reconnectTimer.setTimeout() // fires after 1000 | ||
// reconnectTimer.scheduleTimeout() // fires after 1000 | ||
// | ||
@@ -1011,17 +1012,7 @@ | ||
// Cancels any previous setTimeout and schedules callback | ||
// Cancels any previous scheduleTimeout and schedules callback | ||
}, { | ||
key: "setTimeout", | ||
value: (function (_setTimeout) { | ||
function setTimeout() { | ||
return _setTimeout.apply(this, arguments); | ||
} | ||
setTimeout.toString = function () { | ||
return _setTimeout.toString(); | ||
}; | ||
return setTimeout; | ||
})(function () { | ||
key: "scheduleTimeout", | ||
value: function scheduleTimeout() { | ||
var _this12 = this; | ||
@@ -1035,3 +1026,3 @@ | ||
}, this.timerCalc(this.tries + 1)); | ||
}) | ||
} | ||
}]); | ||
@@ -1038,0 +1029,0 @@ |
{ | ||
"name": "phoenix-socket", | ||
"version": "1.1.0", | ||
"version": "1.1.3", | ||
"description": "Socket API for accessing Phoenix Framework's Channels", | ||
@@ -5,0 +5,0 @@ "main": "dist/socket.js", |
@@ -42,4 +42,5 @@ // Phoenix Channels JavaScript client | ||
// | ||
// Joining a channel with `channel.join(topic, params)`, binds the params to | ||
// `channel.params`. Subsequent rejoins will send up the modified params for | ||
// Creating a channel with `socket.channel(topic, params)`, binds the params to | ||
// `channel.params`, which are sent up on `channel.join()`. | ||
// Subsequent rejoins will send up the modified params for | ||
// updating authorization params, or passing up last_message_id information. | ||
@@ -56,3 +57,3 @@ // Successful joins receive an "ok" status, while unsuccessful joins | ||
// `receive("timeout", callback)` to abort waiting for our other `receive` hooks | ||
// and take action after some period of waiting. | ||
// and take action after some period of waiting. The default timeout is 5000ms. | ||
// | ||
@@ -232,3 +233,3 @@ // | ||
this.state = CHANNEL_STATES.errored | ||
this.rejoinTimer.setTimeout() | ||
this.rejoinTimer.scheduleTimeout() | ||
}) | ||
@@ -240,3 +241,3 @@ this.joinPush.receive("timeout", () => { | ||
this.state = CHANNEL_STATES.errored | ||
this.rejoinTimer.setTimeout() | ||
this.rejoinTimer.scheduleTimeout() | ||
}) | ||
@@ -249,3 +250,3 @@ this.on(CHANNEL_EVENTS.reply, (payload, ref) => { | ||
rejoinUntilConnected(){ | ||
this.rejoinTimer.setTimeout() | ||
this.rejoinTimer.scheduleTimeout() | ||
if(this.socket.isConnected()){ | ||
@@ -459,3 +460,3 @@ this.rejoin() | ||
clearInterval(this.heartbeatTimer) | ||
this.reconnectTimer.setTimeout() | ||
this.reconnectTimer.scheduleTimeout() | ||
this.stateChangeCallbacks.close.forEach( callback => callback(event) ) | ||
@@ -708,6 +709,6 @@ } | ||
// }) | ||
// reconnectTimer.setTimeout() // fires after 1000 | ||
// reconnectTimer.setTimeout() // fires after 5000 | ||
// reconnectTimer.scheduleTimeout() // fires after 1000 | ||
// reconnectTimer.scheduleTimeout() // fires after 5000 | ||
// reconnectTimer.reset() | ||
// reconnectTimer.setTimeout() // fires after 1000 | ||
// reconnectTimer.scheduleTimeout() // fires after 1000 | ||
// | ||
@@ -727,4 +728,4 @@ class Timer { | ||
// Cancels any previous setTimeout and schedules callback | ||
setTimeout(){ | ||
// Cancels any previous scheduleTimeout and schedules callback | ||
scheduleTimeout(){ | ||
clearTimeout(this.timer) | ||
@@ -731,0 +732,0 @@ |
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
54816
1576