code: function recursivePoll(callback, fulfill, reject, interval, maxInterval, intervalIncreaseFactor, timeElapsed, timeout, flags) {
  
    // return if poll has been cancelled in meanwhile
    if (flags.isCancelled) return reject('Poll request has been cancelled')
    // increase interval
    if (interval < maxInterval) interval *= intervalIncreaseFactor
    // check timeout
    if (timeElapsed > timeout) return reject('Poll request timed out')
    // count time
    timeElapsed += interval
    // call
    callback(fulfill, reject, function next() {
      setTimeout(function(){
        recursivePoll(callback, fulfill, reject, interval, maxInterval, intervalIncreaseFactor, timeElapsed, timeout, flags)
      }, interval)
    })
  
  }
docs: helper