implement a more reasonable update interval check frequency (#33)

This commit is contained in:
Guillermo Rauch 2016-07-04 18:13:44 -07:00
parent 33e3d487a1
commit cf0a5783c5
2 changed files with 5 additions and 1 deletions

View file

@ -7,6 +7,7 @@
"hterm-umd": "1.0.1",
"json-loader": "0.5.4",
"mousetrap": "1.6.0",
"ms": "0.7.1",
"react": "15.1.0",
"react-addons-shallow-compare": "15.1.0",
"react-dom": "15.1.0",

View file

@ -1,10 +1,13 @@
/*global fetch:false*/
import { version as currentVersion } from '../package';
import compare from 'semver-compare';
import ms from 'ms';
const DEFAULT_INTERVAL = ms('5m');
export default class UpdateChecker {
constructor (fn, { interval = 5000 } = {}) {
constructor (fn, { interval = DEFAULT_INTERVAL } = {}) {
this.callback = fn;
this.interval = interval;
this.check();