Skip to content

Commit

Permalink
Relays+Infallible
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikhail Markin committed Jun 18, 2022
1 parent e0ab8c4 commit 3a257bd
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions RxRelay/Relays+Infallible.swift
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())
}
}

0 comments on commit 3a257bd

Please sign in to comment.