From 3a257bde5b5c1ad84c254dd37aad558759d6fb50 Mon Sep 17 00:00:00 2001 From: Mikhail Markin <> Date: Sat, 18 Jun 2022 20:28:52 +0800 Subject: [PATCH 1/3] Relays+Infallible --- RxRelay/Relays+Infallible.swift | 34 +++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 RxRelay/Relays+Infallible.swift diff --git a/RxRelay/Relays+Infallible.swift b/RxRelay/Relays+Infallible.swift new file mode 100644 index 0000000000..b179c19e8c --- /dev/null +++ b/RxRelay/Relays+Infallible.swift @@ -0,0 +1,34 @@ +// +// Relays+Infallible.swift +// RxSwift +// +// Created by Mikhail Markin on 18/06/2022. +// Copyright © 2022 Krunoslav Zaher. All rights reserved. +// + +public extension BehaviorRelay { + /// Convert to an `Infallible` + /// + /// - returns: `Infallible` + func asInfallible() -> Infallible { + Infallible(self.asObservable()) + } +} + +public extension PublishRelay { + /// Convert to an `Infallible` + /// + /// - returns: `Infallible` + func asInfallible() -> Infallible { + Infallible(self.asObservable()) + } +} + +public extension ReplayRelay { + /// Convert to an `Infallible` + /// + /// - returns: `Infallible` + func asInfallible() -> Infallible { + Infallible(self.asObservable()) + } +} From b67e34428c1ff70a1c660ebc552d1d56bf6b50c4 Mon Sep 17 00:00:00 2001 From: Mikhail Markin <> Date: Sun, 14 Aug 2022 16:33:02 +0800 Subject: [PATCH 2/3] Revert "Relays+Infallible" This reverts commit 3a257bde5b5c1ad84c254dd37aad558759d6fb50. --- RxRelay/Relays+Infallible.swift | 34 --------------------------------- 1 file changed, 34 deletions(-) delete mode 100644 RxRelay/Relays+Infallible.swift diff --git a/RxRelay/Relays+Infallible.swift b/RxRelay/Relays+Infallible.swift deleted file mode 100644 index b179c19e8c..0000000000 --- a/RxRelay/Relays+Infallible.swift +++ /dev/null @@ -1,34 +0,0 @@ -// -// Relays+Infallible.swift -// RxSwift -// -// Created by Mikhail Markin on 18/06/2022. -// Copyright © 2022 Krunoslav Zaher. All rights reserved. -// - -public extension BehaviorRelay { - /// Convert to an `Infallible` - /// - /// - returns: `Infallible` - func asInfallible() -> Infallible { - Infallible(self.asObservable()) - } -} - -public extension PublishRelay { - /// Convert to an `Infallible` - /// - /// - returns: `Infallible` - func asInfallible() -> Infallible { - Infallible(self.asObservable()) - } -} - -public extension ReplayRelay { - /// Convert to an `Infallible` - /// - /// - returns: `Infallible` - func asInfallible() -> Infallible { - Infallible(self.asObservable()) - } -} From 8ede207aa9072c6c72f305c5fc1d438d959daa8c Mon Sep 17 00:00:00 2001 From: Mikhail Markin <> Date: Sun, 14 Aug 2022 16:33:43 +0800 Subject: [PATCH 3/3] Updated existing Relays .asInfallible() --- RxRelay/BehaviorRelay.swift | 2 +- RxRelay/PublishRelay.swift | 2 +- RxRelay/ReplayRelay.swift | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/RxRelay/BehaviorRelay.swift b/RxRelay/BehaviorRelay.swift index 9ab2a4e921..5e745c2f51 100644 --- a/RxRelay/BehaviorRelay.swift +++ b/RxRelay/BehaviorRelay.swift @@ -44,6 +44,6 @@ public final class BehaviorRelay: ObservableType { /// /// - returns: `Infallible` public func asInfallible() -> Infallible { - asInfallible(onErrorFallbackTo: .empty()) + Infallible(self.asObservable()) } } diff --git a/RxRelay/PublishRelay.swift b/RxRelay/PublishRelay.swift index 1d9f52a1c8..eadee0f430 100644 --- a/RxRelay/PublishRelay.swift +++ b/RxRelay/PublishRelay.swift @@ -38,6 +38,6 @@ public final class PublishRelay: ObservableType { /// /// - returns: `Infallible` public func asInfallible() -> Infallible { - asInfallible(onErrorFallbackTo: .empty()) + Infallible(self.asObservable()) } } diff --git a/RxRelay/ReplayRelay.swift b/RxRelay/ReplayRelay.swift index 604942de1c..20931e80e6 100644 --- a/RxRelay/ReplayRelay.swift +++ b/RxRelay/ReplayRelay.swift @@ -52,6 +52,6 @@ public final class ReplayRelay: ObservableType { /// /// - returns: `Infallible` public func asInfallible() -> Infallible { - asInfallible(onErrorFallbackTo: .empty()) + Infallible(self.asObservable()) } }