RxSwift 6.5.0 - Swift Concurrency is here! 🎊💯
You can now use await
on Observable
-conforming objects (as well as Driver
, Signal
, Infallible
, Single
, Completable
) using the following syntax:
do {
for try await value in observable.values {
print(value) // Next event
}
// Completed here
} catch {
// Error event
print("An error occurred:", error.localizedDescription)
}
Check out the full documentation for additional information: https://github.com/ReactiveX/RxSwift/blob/main/Documentation/SwiftConcurrency.md