Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
reconnect(): make logging to console optional
  • Loading branch information
skladd committed Jul 15, 2016
commit 84d4496ff06dc0e343c9af7d51d11fd3b2140b2a
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 2.0.1 (unreleased)

Features:
- reconnect(): Make logging to console optional

## 2.0.0 (2016-5-21)

Features:
Expand Down
13 changes: 5 additions & 8 deletions dist/angular-websocket.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@
};
}

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
return typeof obj;
} : function (obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj;
};

var Socket;

if (typeof window === 'undefined') {
Expand Down Expand Up @@ -98,6 +92,7 @@
this.initialTimeout = options && options.initialTimeout || 500; // 500ms
this.maxTimeout = options && options.maxTimeout || 5 * 60 * 1000; // 5 minutes
this.reconnectIfNotNormalClose = options && options.reconnectIfNotNormalClose || false;
this.consoleLogReconnect = options && options.consoleLogReconnect && true;
this.binaryType = options && options.binaryType || 'blob';

this._reconnectAttempts = 0;
Expand Down Expand Up @@ -333,7 +328,9 @@
var backoffDelay = this._getBackoffDelay(++this._reconnectAttempts);

var backoffDelaySeconds = backoffDelay / 1000;
console.log('Reconnecting in ' + backoffDelaySeconds + ' seconds');
if (this.consoleLogReconnect) {
console.log('Reconnecting in ' + backoffDelaySeconds + ' seconds');
}

$timeout(_angular2.default.bind(this, this._connect), backoffDelay);

Expand Down Expand Up @@ -412,4 +409,4 @@

exports.default = _angular2.default.module('ngWebSocket');
module.exports = exports['default'];
});
});
2 changes: 1 addition & 1 deletion dist/angular-websocket.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading