docs/Protocols/ObservableConvertibleType.html
public protocol ObservableConvertibleType
Type that can be converted to observable sequence (Observable<Element>).
`
Element
`
Type of elements in sequence.
Swift
associatedtype Element
`
asObservable()
`
Converts self to Observable sequence.
Swift
func asObservable() -> Observable<Element>
Observable sequence that represents self.
`
values
` Extension method
Allows iterating over the values of an Observable asynchronously via Swift’s concurrency features (async/await)
A sample usage would look like so:
do {
for try await value in observable.values {
// Handle emitted values
}
} catch {
// Handle error
}
Swift
var values: AsyncThrowingStream<Element, Error> { get }
`
asInfallible(onErrorJustReturn:)
` Extension method
Convert to an Infallible
Swift
func asInfallible(onErrorJustReturn element: Element) -> Infallible<Element>
Infallible<Element>
`
asInfallible(onErrorFallbackTo:)
` Extension method
Convert to an Infallible
Swift
func asInfallible(onErrorFallbackTo infallible: Infallible<Element>) -> Infallible<Element>
| infallible |
Fall back to this provided infallible on error
|
Infallible<Element>
`
asInfallible(onErrorRecover:)
` Extension method
Convert to an Infallible
Swift
func asInfallible(onErrorRecover: @escaping (Swift.Error) -> Infallible<Element>) -> Infallible<Element>
| onErrorRecover |
Recover with the this infallible closure
|
Infallible<Element>