Add stopPolling method

This commit is contained in:
Maciej Małecki 2014-04-16 09:36:04 +02:00
parent 5e4369da27
commit 926e10da01

View file

@ -146,8 +146,13 @@ Trader.prototype.startPolling = function () {
this.pollBalance(); this.pollBalance();
this.pollRate(); this.pollRate();
setInterval(this.pollBalance.bind(this), 60 * 1000); this.balanceInterval = setInterval(this.pollBalance.bind(this), 60 * 1000);
setInterval(this.pollRate.bind(this), 60 * 1000); this.rateInterval = setInterval(this.pollRate.bind(this), 60 * 1000);
};
Trader.prototype.stopPolling = function () {
clearInterval(this.balanceInterval);
clearInterval(this.rateInterval);
}; };
Trader.prototype.pollBalance = function () { Trader.prototype.pollBalance = function () {