title: Convert Javascript callback which can be called multiple times into promise
body: <p>Is there a way to convert a Javascript call with callback which can be called multiple times into a promise?</p>
  
  <p>Say,</p>
  
  <pre><code>scan(function(result) {
    // this is actually a Bluetooth device scan (Cordova), and 
    // will return something when a device is found.
    // So this can be called more than once.
  });
  </code></pre>
  
  <p>And wrap that into a promise?</p>
  
  <pre><code>function scanP {
    return new Promise(function(resolve, reject) {
      scan(function (result) {
       resolve(result); // attempt to call repeatedly, but doesn't work.
      });
    });
  }
  
  scanP(function(result) {
     // check if this device is what we want.
  })
  .catch(function(err) {
    // handle error
  });
  </code></pre>
  
  <p>I also need this pattern to subscribe to data from a Bluetooth device. Is promise not suitable for this task?</p>
  
  <p><strong>EDIT:</strong> I'm using Bluebird.</p>