title: RxSwift: Repeat a (completed) stream
body: <p>Assume I have a button which can be used to start and stop (toggle) an action.</p>
  
  <pre><code>let toggleStream: Observable&lt;Bool&gt; = toggleBtn.rx.tap.scan(false) { state, _ in !state }
  </code></pre>
  
  <p>I have another stream, that emits Integers continuously.</p>
  
  <pre><code>let emitter = Observable&lt;Int&gt;.interval(2.0, scheduler: timerScheduler)
  </code></pre>
  
  <p>Now I want to use the toggle stream to start and stop the emitting of the second stream. This is my approach:</p>
  
  <pre><code>Observable.combineLatest(toggleStream, emitter) { shouldEmit, evt in
      return (shouldEmit, evt)
  }.takeWhile{ (shouldEmit, evt:Int) in
      return shouldEmit == true
  }.map {(_, evt) in
      return evt
  }
  </code></pre>
  
  <p>This works great for the first time. I can press the button and the <code>Observable</code> starts emitting its <code>Ints</code>. Also stopping works. Sadly I can't start it for a second time, because the stream is completed. How can I restart/retry/repeat it when the user toggles the button again?</p>