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
// Decay class, to call a callback less and less often. For example, | |
// make an Ajax request and freshen the decay only if the request has changed. | |
// | |
// To start the timeouts, call decay_object.start() | |
// To freshen up the speed of query, call decay_object.reset() | |
// | |
// Options: | |
// - seconds: time between each callback at the start and after a reset() (default 2) | |
// - decay: multiplier to use after each callback call (default 1.3) | |
// - max: maximum number of seconds to wait between each call (default 42) |
NewerOlder