Skip to content

Instantly share code, notes, and snippets.

@augustovictor
Created April 20, 2017 20:58
Show Gist options
  • Select an option

  • Save augustovictor/81940617534d24a1d220a1fb3a23b7f5 to your computer and use it in GitHub Desktop.

Select an option

Save augustovictor/81940617534d24a1d220a1fb3a23b7f5 to your computer and use it in GitHub Desktop.
'use strict';
class FetchDataManagerSingleton extends Map {
static get [Symbol.species]() {
return Map;
}
constructor() {
this.fetchCount = 0;
this.timeTilNextFetch = 5000;
}
static updateTimeTilNextFetch(newValue) {
this.timeTilNextFetch = newValue;
}
show() {
console.log(this.entries());
}
}
module.exports = new FetchDataManagerSingleton();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment