rxjs infinite loop with an interval variable
<p>I want to make infinite loop with an interval variable using rxjs Observable 
so I'm trying to rewrite this function in rxjs</p>

<pre><code>takeAWalk(player){
    setTimeout(() =&gt; {

      console.log("Player is walking...");

      takeAWalk(player);
    }, getRandomDelayBetween(1000, 2500));
}
</code></pre>

<p>I tried</p>

<pre><code>Observable
  .timer(0, getRandomDelayBetween(1000, 2500))
  .take(10)
  .timeInterval()
  .subscribe(res=&gt;{
    console.log("player is walking ...");
  });
</code></pre>

<p>but the problem that this is finite to 10 and the interval is constant  (<code>getRandomDelayBetween</code> is only called once).</p>

<p>Which operators should I use to produce the same functionality of <code>takeAWalk</code> function?</p>