RxSwift repeated action
<p>I'm switching from RAC and want to have a repeated network request, returning different result types depending on the API of the request.</p>

<p>I want to use an interval, but I don't know how to match the return types. </p>

<pre><code>var loop: Observable&lt;Element&gt; {
    return Observable&lt;Int&gt;.interval(5.0, scheduler: MainScheduler.instance).map { _ in
        // Do network request and return Observable&lt;Element&gt;
    }
}
</code></pre>

<p>I need to invoke Observerable.interval with type Int - but return Observable. How would I do that?</p>