Correct way to restart observable interval in RxSwift
<p>In my OS X status bar app I'm using <code>interval</code> function to periodically call an external api and display the result:</p>

<pre><code>Observable&lt;Int&gt;
    .interval(120.0, scheduler: MainScheduler.instance)
    .startWith(-1) // to start immediately
    .flatMapLatest(makeRequest) // makeRequest is (dummy: Int) -&gt; Observable&lt;SummaryResponse?&gt;
    .subscribeNext(setSummary)
    .addDisposableTo(disposeBag)
</code></pre>

<p>However, if user changes the preferences in the meantime, I would like to "restart" this interval and make a new call immediately to reflect the changes (without having to wait for the next call). </p>

<p>What's the best way to do this?</p>

<ol>
<li>Store the observable as a property and set it to <code>nil</code> or call <code>.dispose()</code> on it (or both) and create a new observable ?</li>
<li>Set <code>disposeBag</code> to <code>nil</code> and create a new observable ?</li>
<li>Any other way?</li>
</ol>