I'm switching from RAC and want to have a repeated network request, returning different result types depending on the API of the request.
I want to use an interval, but I don't know how to match the return types.
var loop: Observable<Element> {
return Observable<Int>.interval(5.0, scheduler: MainScheduler.instance).map { _ in
// Do network request and return Observable<Element>
}
}
I need to invoke Observerable.interval with type Int - but return Observable. How would I do that?