As of RxSwift4, Variable
is moved to Deprecated.swift
marking the possible deprecation of Variable
in future. An alternate proposed to
I would do something like that -
let requests = PublishSubject>.create()
let responses: Observable = requests.switchLatest()
let parsed: Observable<[ParsedItem]> = responses
.flatMap { Observable.from($0).map { parse($0) }.toArray() }
parsed.bind(to: ui)
// repeated part
let request1: Observable = servive.call()
request.onNext(request1)