ReactiveX.io documentation, RxSwift 2.x sürümündeki AnonymousDisposable
'u kullanır, ancak RxSwift 3.0'da çözümlenmemiş bir tanıtıcıdır. Bunun yerine ne kullanmalıyım?RxSwift 2.x, AnonymousDisposable için RxSwift 3.0 eşdeğeri nedir?
let source = Observable.create { observer in
for i in 1...5 {
observer.on(.Next(i))
}
observer.on(.Completed)
// Note that this is optional. If you require no cleanup you can return
// NopDisposable.instance
return AnonymousDisposable {
print("Disposed")
}
}
source.subscribe {
print($0)
}