title: How do I repeat an ajax request until a condition is met with RxJS Observable?
body: <p>I'm attempting to repeat a request until the response has data using RxJS, at which point I'd like to call a success (or failure) handler, but I'm having trouble w/RxJS. Here's my current approach:</p>
  
  <pre><code>// ... redux-observable action observable
  .mergeMap(() =&gt;
      fetchData()
      .repeatWhen(response =&gt;
          response.takeWhile(({ data }) =&gt; !data.length)
          .of(response)
      )
  )
  .map(successFunction)
  .catch(failureFunction);
  </code></pre>
  
  <p>Disclaimer: I'm quite new to RxJS....</p>