title: Rx.js: check sequence of items asynchronously with promise and take until true is returned
body: <p>I'm very new to Rx. I have an array of usernames and I'm testing them against a db until I get to one which doesn't exist (a free one). The db call gives me a promise.</p>
  
  <p>How can I implement it with rx(.js)?</p>
  
  <p>The code I implemented until now is:</p>
  
  <p>the usernames stream</p>
  
  <pre><code>var usernamesStream = Rx.Observable.from(['user1','user2','user3'])
  </code></pre>
  
  <p>the db query method</p>
  
  <pre><code>var checkUsernameIsFree = function (username) {
    return db.users.find({username:username}).toArray().then(function(users) {
      return users.length == 0
    })
  }
  </code></pre>
  
  <p>I guess I should create a stream by using <code>.fromPromise</code> on the promise. How can I implement that and join the 2 streams so that <code>subscribe</code> gets called only with the first free username?</p>