Back to Rxswift

Infallible

docs/Structs/Infallible.html

6.10.212.4 KB
Original Source

Infallible

public struct Infallible<Element> : InfallibleType

Infallible is an Observable-like push-style interface which is guaranteed to not emit error events.

Unlike SharedSequence, it does not share its resources or replay its events, but acts as a standard Observable.

`

                asObservable()
                `

Declaration

Swift

public func asObservable() -> Observable<Element>

Combine Latest

`

                combineLatest(_:_:resultSelector:)
                `

Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element.

Seealso

combineLatest operator on reactivex.io

Declaration

Swift

static func combineLatest<I1: InfallibleType, I2: InfallibleType>
(_ source1: I1, _ source2: I2, resultSelector: @escaping (I1.Element, I2.Element) throws -> Element)
    -> Infallible<Element>

Parameters

| resultSelector |

Function to invoke whenever any of the sources produces an element.

|

Return Value

An observable sequence containing the result of combining elements of the sources using the specified result selector function.

`

                combineLatest(_:_:_:resultSelector:)
                `

Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element.

Seealso

combineLatest operator on reactivex.io

Declaration

Swift

static func combineLatest<I1: InfallibleType, I2: InfallibleType, I3: InfallibleType>
(_ source1: I1, _ source2: I2, _ source3: I3, resultSelector: @escaping (I1.Element, I2.Element, I3.Element) throws -> Element)
    -> Infallible<Element>

Parameters

| resultSelector |

Function to invoke whenever any of the sources produces an element.

|

Return Value

An observable sequence containing the result of combining elements of the sources using the specified result selector function.

`

                combineLatest(_:_:_:_:resultSelector:)
                `

Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element.

Seealso

combineLatest operator on reactivex.io

Declaration

Swift

static func combineLatest<I1: InfallibleType, I2: InfallibleType, I3: InfallibleType, I4: InfallibleType>
(_ source1: I1, _ source2: I2, _ source3: I3, _ source4: I4, resultSelector: @escaping (I1.Element, I2.Element, I3.Element, I4.Element) throws -> Element)
    -> Infallible<Element>

Parameters

| resultSelector |

Function to invoke whenever any of the sources produces an element.

|

Return Value

An observable sequence containing the result of combining elements of the sources using the specified result selector function.

`

                combineLatest(_:_:_:_:_:resultSelector:)
                `

Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element.

Seealso

combineLatest operator on reactivex.io

Declaration

Swift

static func combineLatest<I1: InfallibleType, I2: InfallibleType, I3: InfallibleType, I4: InfallibleType, I5: InfallibleType>
(_ source1: I1, _ source2: I2, _ source3: I3, _ source4: I4, _ source5: I5, resultSelector: @escaping (I1.Element, I2.Element, I3.Element, I4.Element, I5.Element) throws -> Element)
    -> Infallible<Element>

Parameters

| resultSelector |

Function to invoke whenever any of the sources produces an element.

|

Return Value

An observable sequence containing the result of combining elements of the sources using the specified result selector function.

`

                combineLatest(_:_:_:_:_:_:resultSelector:)
                `

Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element.

Seealso

combineLatest operator on reactivex.io

Declaration

Swift

static func combineLatest<I1: InfallibleType, I2: InfallibleType, I3: InfallibleType, I4: InfallibleType, I5: InfallibleType, I6: InfallibleType>
(_ source1: I1, _ source2: I2, _ source3: I3, _ source4: I4, _ source5: I5, _ source6: I6, resultSelector: @escaping (I1.Element, I2.Element, I3.Element, I4.Element, I5.Element, I6.Element) throws -> Element)
    -> Infallible<Element>

Parameters

| resultSelector |

Function to invoke whenever any of the sources produces an element.

|

Return Value

An observable sequence containing the result of combining elements of the sources using the specified result selector function.

`

                combineLatest(_:_:_:_:_:_:_:resultSelector:)
                `

Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element.

Seealso

combineLatest operator on reactivex.io

Declaration

Swift

static func combineLatest<I1: InfallibleType, I2: InfallibleType, I3: InfallibleType, I4: InfallibleType, I5: InfallibleType, I6: InfallibleType, I7: InfallibleType>
(_ source1: I1, _ source2: I2, _ source3: I3, _ source4: I4, _ source5: I5, _ source6: I6, _ source7: I7, resultSelector: @escaping (I1.Element, I2.Element, I3.Element, I4.Element, I5.Element, I6.Element, I7.Element) throws -> Element)
    -> Infallible<Element>

Parameters

| resultSelector |

Function to invoke whenever any of the sources produces an element.

|

Return Value

An observable sequence containing the result of combining elements of the sources using the specified result selector function.

`

                combineLatest(_:_:_:_:_:_:_:_:resultSelector:)
                `

Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element.

Seealso

combineLatest operator on reactivex.io

Declaration

Swift

static func combineLatest<I1: InfallibleType, I2: InfallibleType, I3: InfallibleType, I4: InfallibleType, I5: InfallibleType, I6: InfallibleType, I7: InfallibleType, I8: InfallibleType>
(_ source1: I1, _ source2: I2, _ source3: I3, _ source4: I4, _ source5: I5, _ source6: I6, _ source7: I7, _ source8: I8, resultSelector: @escaping (I1.Element, I2.Element, I3.Element, I4.Element, I5.Element, I6.Element, I7.Element, I8.Element) throws -> Element)
    -> Infallible<Element>

Parameters

| resultSelector |

Function to invoke whenever any of the sources produces an element.

|

Return Value

An observable sequence containing the result of combining elements of the sources using the specified result selector function.

`

                InfallibleObserver
                `

Undocumented

Declaration

Swift

typealias InfallibleObserver = (InfallibleEvent<Element>) -> Void

`

                create(subscribe:)
                `

Creates an observable sequence from a specified subscribe method implementation.

Seealso

create operator on reactivex.io

Declaration

Swift

static func create(subscribe: @escaping (@escaping InfallibleObserver) -> Disposable) -> Infallible<Element>

Parameters

| subscribe |

Implementation of the resulting observable sequence’s subscribe method.

|

Return Value

The observable sequence with the specified implementation for the subscribe method.

From & Of

`

                of(_:scheduler:)
                `

This method creates a new Infallible instance with a variable number of elements.

Seealso

from operator on reactivex.io

Declaration

Swift

static func of(_ elements: Element..., scheduler: ImmediateSchedulerType = CurrentThreadScheduler.instance) -> Infallible<Element>

Parameters

| elements |

Elements to generate.

| | scheduler |

Scheduler to send elements on. If nil, elements are sent immediately on subscription.

|

Return Value

The Infallible sequence whose elements are pulled from the given arguments.

`

                from(_:scheduler:)
                `

Converts an array to an Infallible sequence.

Seealso

from operator on reactivex.io

Declaration

Swift

static func from(_ array: [Element], scheduler: ImmediateSchedulerType = CurrentThreadScheduler.instance) -> Infallible<Element>

Return Value

The Infallible sequence whose elements are pulled from the given enumerable sequence.

`

                from(_:scheduler:)
                `

Converts a sequence to an Infallible sequence.

Seealso

from operator on reactivex.io

Declaration

Swift

static func from<Sequence>(_ sequence: Sequence, scheduler: ImmediateSchedulerType = CurrentThreadScheduler.instance) -> Infallible<Element> where Element == Sequence.Element, Sequence : Sequence

Return Value

The Infallible sequence whose elements are pulled from the given enumerable sequence.

Do

`

                do(onNext:afterNext:onCompleted:afterCompleted:onSubscribe:onSubscribed:onDispose:)
                `

Invokes an action for each event in the infallible sequence, and propagates all observer messages through the result sequence.

Seealso

do operator on reactivex.io

Declaration

Swift

func `do`(onNext: ((Element) throws -> Void)? = nil, afterNext: ((Element) throws -> Void)? = nil, onCompleted: (() throws -> Void)? = nil, afterCompleted: (() throws -> Void)? = nil, onSubscribe: (() -> Void)? = nil, onSubscribed: (() -> Void)? = nil, onDispose: (() -> Void)? = nil) -> Infallible<Element>

Parameters

| onNext |

Action to invoke for each element in the observable sequence.

| | afterNext |

Action to invoke for each element after the observable has passed an onNext event along to its downstream.

| | onCompleted |

Action to invoke upon graceful termination of the observable sequence.

| | afterCompleted |

Action to invoke after graceful termination of the observable sequence.

| | onSubscribe |

Action to invoke before subscribing to source observable sequence.

| | onSubscribed |

Action to invoke after subscribing to source observable sequence.

| | onDispose |

Action to invoke after subscription to source observable has been disposed for any reason. It can be either because sequence terminates for some reason or observer subscription being disposed.

|

Return Value

The source sequence with the side-effecting behavior applied.