title: Is there a lodash function to wait for a condition?
body: <p>I'm using an API which provides an async method used like this:</p>
  
  <pre><code>api.isActive(function(err, active) {
      // check for error
      // use active boolean
  });
  </code></pre>
  
  <p>The underlying object state is "volatile", i.e. it changes without any interaction from the program.</p>
  
  <p>I'd like to wait for a given state - this will involve calling isActive repeatedly (with some interval) until the desired state is determined. The entire operation should be given a maximum amount of time for the state to be achieved before bailing out. An old-school nodejs <code>callback(err)</code> should be called with the completion (this can be promise-ified later).</p>
  
  <p>I could write some code with <code>setTimeout()</code> but I'd prefer to use a canned solution or pattern, and lodash seems likely to provide something but I can't quite see what method could be used for this.</p>