forked from ReactiveX/RxSwift
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Mikhail Markin
committed
Jun 18, 2022
1 parent
e0ab8c4
commit 3a257bd
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<Element>` | ||
func asInfallible() -> Infallible<Element> { | ||
Infallible(self.asObservable()) | ||
} | ||
} | ||
|
||
public extension PublishRelay { | ||
/// Convert to an `Infallible` | ||
/// | ||
/// - returns: `Infallible<Element>` | ||
func asInfallible() -> Infallible<Element> { | ||
Infallible(self.asObservable()) | ||
} | ||
} | ||
|
||
public extension ReplayRelay { | ||
/// Convert to an `Infallible` | ||
/// | ||
/// - returns: `Infallible<Element>` | ||
func asInfallible() -> Infallible<Element> { | ||
Infallible(self.asObservable()) | ||
} | ||
} |