* @param {number} interval How often should browser call poll functions (ms) * @param {function()} setTimeout Reference to a real or fake `setTimeout` function. * * @description * Configures the poller to run in the specified intervals, using the specified * setTimeout fn and kicks it
(interval, setTimeout)
| 5008 | * setTimeout fn and kicks it off. |
| 5009 | */ |
| 5010 | function startPoller(interval, setTimeout) { |
| 5011 | (function check() { |
| 5012 | forEach(pollFns, function(pollFn) { pollFn(); }); |
| 5013 | pollTimeout = setTimeout(check, interval); |
| 5014 | })(); |
| 5015 | } |
| 5016 | |
| 5017 | ////////////////////////////////////////////////////////////// |
| 5018 | // URL API |