Created
June 8, 2016 13:37
-
-
Save sangress/6b18da275f4eb570d42dfb87a4c16d14 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let pollDelay = 750; | |
function () { | |
this.m = _.memoize(function (time) { | |
return time + pollDelay; | |
}); | |
this.t = 0; | |
this.rm = _.noop; | |
this.getEvents = function () { | |
var t = this.t; | |
this.rm = _.memoize(function () { | |
return t; | |
}); | |
this.t = this.m(new Date().getTime()); | |
console.log(this.t - this.rm(), this.t - this.rm() === pollDelay) | |
$http.get('this.apiUrl', {}).then(function (res) { | |
}); | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment