* @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)
| 3105 | * setTimeout fn and kicks it off. |
| 3106 | */ |
| 3107 | function startPoller(interval, setTimeout) { |
| 3108 | (function check() { |
| 3109 | forEach(pollFns, function(pollFn){ pollFn(); }); |
| 3110 | pollTimeout = setTimeout(check, interval); |
| 3111 | })(); |
| 3112 | } |
| 3113 | |
| 3114 | ////////////////////////////////////////////////////////////// |
| 3115 | // URL API |