battery-friendly-timer
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -77,5 +77,6 @@ 'use strict'; | ||
var now = Date.now(); | ||
var interval = { from: now, latest: now, callback: callback, tryDelay: tryDelay }; | ||
var interval = { from: now, latest: now, callback: callback, tryDelay: tryDelay, forceDelay: forceDelay }; | ||
this.intervals[latestId] = interval; | ||
this.forceIntervals[latestId] = this.win.setInterval(function () { | ||
now = Date.now(); | ||
if (now - interval.latest >= interval.forceDelay) { | ||
@@ -82,0 +83,0 @@ callback(); |
{ | ||
"name": "battery-friendly-timer", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Mobile applications using `setInterval` to poll a server are a battery hogs. Save battery life by fetching data at the right moment.", | ||
@@ -34,4 +34,5 @@ "files": [ | ||
"eslint-plugin-react": "^6.1.2", | ||
"mocha": "^3.0.2" | ||
"mocha": "^3.0.2", | ||
"sinon": "^1.17.7" | ||
} | ||
} |
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
12670
114
12