From ef1d4dea3ee6ed337ab2e14211b981223f7ccd30 Mon Sep 17 00:00:00 2001 From: Shai Mishali Date: Fri, 4 Oct 2024 23:25:58 +0300 Subject: [PATCH] Complete async Observable on CancellationError --- RxSwift/Observable+Concurrency.swift | 2 ++ .../PrimitiveSequence/PrimitiveSequence+Concurrency.swift | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/RxSwift/Observable+Concurrency.swift b/RxSwift/Observable+Concurrency.swift index 45ad05ede..af3ec72bc 100644 --- a/RxSwift/Observable+Concurrency.swift +++ b/RxSwift/Observable+Concurrency.swift @@ -66,6 +66,8 @@ public extension AsyncSequence { observer.onNext(value) } + observer.onCompleted() + } catch is CancellationError { observer.onCompleted() } catch { observer.onError(error) diff --git a/RxSwift/Traits/PrimitiveSequence/PrimitiveSequence+Concurrency.swift b/RxSwift/Traits/PrimitiveSequence/PrimitiveSequence+Concurrency.swift index 271df34d4..68b816b8b 100644 --- a/RxSwift/Traits/PrimitiveSequence/PrimitiveSequence+Concurrency.swift +++ b/RxSwift/Traits/PrimitiveSequence/PrimitiveSequence+Concurrency.swift @@ -12,7 +12,7 @@ import Foundation @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) public extension PrimitiveSequenceType where Trait == SingleTrait { /** - Creates an `Single` from the result of an asynchronous operation + Creates a `Single` from the result of an asynchronous operation - seealso: [create operator on reactivex.io](http://reactivex.io/documentation/operators/create.html)