docs/Protocols/InfallibleType.html
public protocol InfallibleType : ObservableConvertibleType
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.
`
combineLatest(_:resultSelector:)
` Extension method
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
Swift
static func combineLatest<Collection: Swift.Collection>(_ collection: Collection, resultSelector: @escaping ([Collection.Element.Element]) throws -> Element) -> Infallible<Element>
where Collection.Element: InfallibleType
| resultSelector |
Function to invoke whenever any of the sources produces an element.
|
An observable sequence containing the result of combining elements of the sources using the specified result selector function.
`
combineLatest(_:)
` Extension method
Merges the specified observable sequences into one observable sequence whenever any of the observable sequences produces an element.
Seealso
combinelatest operator on reactivex.io
Swift
static func combineLatest<Collection: Swift.Collection>(_ collection: Collection) -> Infallible<[Element]>
where Collection.Element: InfallibleType, Collection.Element.Element == Element
An observable sequence containing the result of combining elements of the sources.
`
values
` Extension method
Allows iterating over the values of an Infallible asynchronously via Swift’s concurrency features (async/await)
A sample usage would look like so:
for await value in observable.values {
// Handle emitted values
}
Swift
var values: AsyncStream<Element> { get }
`
just(_:)
` Extension method
Returns an infallible sequence that contains a single element.
Seealso
Swift
static func just(_ element: Element) -> Infallible<Element>
| element |
Single element in the resulting infallible sequence.
|
An infallible sequence containing the single specified element.
`
just(_:scheduler:)
` Extension method
Returns an infallible sequence that contains a single element.
Seealso
Swift
static func just(_ element: Element, scheduler: ImmediateSchedulerType) -> Infallible<Element>
| element |
Single element in the resulting infallible sequence.
|
| scheduler |
Scheduler to send the single element on.
|
An infallible sequence containing the single specified element.
`
never()
` Extension method
Returns a non-terminating infallible sequence, which can be used to denote an infinite duration.
Seealso
never operator on reactivex.io
Swift
static func never() -> Infallible<Element>
An infallible sequence whose observers will never get called.
`
empty()
` Extension method
Returns an empty infallible sequence, using the specified scheduler to send out the single Completed message.
Seealso
empty operator on reactivex.io
Swift
static func empty() -> Infallible<Element>
An infallible sequence with no elements.
`
deferred(_:)
` Extension method
Returns an infallible sequence that invokes the specified factory function whenever a new observer subscribes.
Seealso
defer operator on reactivex.io
Swift
static func deferred(_ observableFactory: @escaping () throws -> Infallible<Element>)
-> Infallible<Element>
| observableFactory |
Observable factory function to invoke for each observer that subscribes to the resulting sequence.
|
An observable sequence whose observers trigger an invocation of the given observable factory function.
`
filter(_:)
` Extension method
Filters the elements of an observable sequence based on a predicate.
Seealso
filter operator on reactivex.io
Swift
func filter(_ predicate: @escaping (Element) -> Bool)
-> Infallible<Element>
| predicate |
A function to test each source element for a condition.
|
An observable sequence that contains elements from the input sequence that satisfy the condition.
`
map(_:)
` Extension method
Projects each element of an observable sequence into a new form.
Seealso
Swift
func map<Result>(_ transform: @escaping (Element) -> Result)
-> Infallible<Result>
| transform |
A transform function to apply to each source element.
|
An observable sequence whose elements are the result of invoking the transform function on each element of source.
`
compactMap(_:)
` Extension method
Projects each element of an observable sequence into an optional form and filters all optional results.
Swift
func compactMap<Result>(_ transform: @escaping (Element) -> Result?)
-> Infallible<Result>
| transform |
A transform function to apply to each source element and which returns an element or nil.
|
An observable sequence whose elements are the result of filtering the transform function for each element of the source.
`
distinctUntilChanged(_:)
` Extension method
Returns an observable sequence that contains only distinct contiguous elements according to the keySelector.
Seealso
distinct operator on reactivex.io
Swift
func distinctUntilChanged(_ keySelector: @escaping (Element) throws -> some Equatable)
-> Infallible<Element>
| keySelector |
A function to compute the comparison key for each element.
|
An observable sequence only containing the distinct contiguous elements, based on a computed key value, from the source sequence.
`
distinctUntilChanged(_:)
` Extension method
Returns an observable sequence that contains only distinct contiguous elements according to the comparer.
Seealso
distinct operator on reactivex.io
Swift
func distinctUntilChanged(_ comparer: @escaping (Element, Element) throws -> Bool)
-> Infallible<Element>
| comparer |
Equality comparer for computed key values.
|
An observable sequence only containing the distinct contiguous elements, based on comparer, from the source sequence.
`
distinctUntilChanged(_:comparer:)
` Extension method
Returns an observable sequence that contains only distinct contiguous elements according to the keySelector and the comparer.
Seealso
distinct operator on reactivex.io
Swift
func distinctUntilChanged<K>(_ keySelector: @escaping (Element) throws -> K, comparer: @escaping (K, K) throws -> Bool)
-> Infallible<Element>
| keySelector |
A function to compute the comparison key for each element.
|
| comparer |
Equality comparer for computed key values.
|
An observable sequence only containing the distinct contiguous elements, based on a computed key value and the comparer, from the source sequence.
`
distinctUntilChanged(at:)
` Extension method
Returns an observable sequence that contains only contiguous elements with distinct values in the provided key path on each object.
Seealso
distinct operator on reactivex.io
Swift
func distinctUntilChanged(at keyPath: KeyPath<Element, some Equatable>) ->
Infallible<Element>
An observable sequence only containing the distinct contiguous elements, based on equality operator on the provided key path
`
debounce(_:scheduler:)
` Extension method
Ignores elements from an observable sequence which are followed by another element within a specified relative time duration, using the specified scheduler to run throttling timers.
Seealso
debounce operator on reactivex.io
Swift
func debounce(_ dueTime: RxTimeInterval, scheduler: SchedulerType)
-> Infallible<Element>
| dueTime |
Throttling duration for each element.
|
| scheduler |
Scheduler to run the throttle timers on.
|
The throttled sequence.
`
throttle(_:latest:scheduler:)
` Extension method
Returns an Observable that emits the first and the latest item emitted by the source Observable during sequential time windows of a specified duration.
This operator makes sure that no two elements are emitted in less then dueTime.
Seealso
debounce operator on reactivex.io
Swift
func throttle(_ dueTime: RxTimeInterval, latest: Bool = true, scheduler: SchedulerType)
-> Infallible<Element>
| dueTime |
Throttling duration for each element.
|
| latest |
Should latest element received in a dueTime wide time window since last element emission be emitted.
|
| scheduler |
Scheduler to run the throttle timers on.
|
The throttled sequence.
`
flatMap(_:)
` Extension method
Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
Seealso
flatMap operator on reactivex.io
Swift
func flatMap<Source: ObservableConvertibleType>(_ selector: @escaping (Element) -> Source)
-> Infallible<Source.Element>
| selector |
A transform function to apply to each element.
|
An observable sequence whose elements are the result of invoking the one-to-many transform function on each element of the input sequence.
`
flatMapLatest(_:)
` Extension method
Projects each element of an observable sequence into a new sequence of observable sequences and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.
It is a combination of map + switchLatest operator
Seealso
flatMapLatest operator on reactivex.io
Swift
func flatMapLatest<Source: ObservableConvertibleType>(_ selector: @escaping (Element) -> Source)
-> Infallible<Source.Element>
| selector |
A transform function to apply to each element.
|
An observable sequence whose elements are the result of invoking the transform function on each element of source producing an Observable of Observable sequences and that at any point in time produces the elements of the most recent inner observable sequence that has been received.
`
flatMapFirst(_:)
` Extension method
Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence. If element is received while there is some projected observable sequence being merged it will simply be ignored.
Seealso
flatMapFirst operator on reactivex.io
Swift
func flatMapFirst<Source: ObservableConvertibleType>(_ selector: @escaping (Element) -> Source)
-> Infallible<Source.Element>
| selector |
A transform function to apply to element that was observed while no observable is executing in parallel.
|
An observable sequence whose elements are the result of invoking the one-to-many transform function on each element of the input sequence that was received while no other sequence was being calculated.
`
concat(_:)
` Extension method
Concatenates the second observable sequence to self upon successful termination of self.
Seealso
concat operator on reactivex.io
Swift
func concat<Source>(_ second: Source) -> Infallible<Element> where Source : ObservableConvertibleType, Self.Element == Source.Element
| second |
Second observable sequence.
|
An observable sequence that contains the elements of self, followed by those of the second sequence.
`
concat(_:)
` Extension method
Concatenates all observable sequences in the given sequence, as long as the previous observable sequence terminated successfully.
This operator has tail recursive optimizations that will prevent stack overflow.
Optimizations will be performed in cases equivalent to following:
[1, [2, [3, …..].concat()].concat].concat()
Seealso
concat operator on reactivex.io
Swift
static func concat<Sequence: Swift.Sequence>(_ sequence: Sequence) -> Infallible<Element>
where Sequence.Element == Infallible<Element>
An observable sequence that contains the elements of each given sequence, in sequential order.
`
concat(_:)
` Extension method
Concatenates all observable sequences in the given collection, as long as the previous observable sequence terminated successfully.
This operator has tail recursive optimizations that will prevent stack overflow.
Optimizations will be performed in cases equivalent to following:
[1, [2, [3, …..].concat()].concat].concat()
Seealso
concat operator on reactivex.io
Swift
static func concat<Collection: Swift.Collection>(_ collection: Collection) -> Infallible<Element>
where Collection.Element == Infallible<Element>
An observable sequence that contains the elements of each given sequence, in sequential order.
`
concat(_:)
` Extension method
Concatenates all observable sequences in the given collection, as long as the previous observable sequence terminated successfully.
This operator has tail recursive optimizations that will prevent stack overflow.
Optimizations will be performed in cases equivalent to following:
[1, [2, [3, …..].concat()].concat].concat()
Seealso
concat operator on reactivex.io
Swift
static func concat(_ sources: Infallible<Element>...) -> Infallible<Element>
An observable sequence that contains the elements of each given sequence, in sequential order.
`
concatMap(_:)
` Extension method
Projects each element of an observable sequence to an observable sequence and concatenates the resulting observable sequences into one observable sequence.
Seealso
concat operator on reactivex.io
Swift
func concatMap<Source: ObservableConvertibleType>(_ selector: @escaping (Element) -> Source)
-> Infallible<Source.Element>
An observable sequence that contains the elements of each observed inner sequence, in sequential order.
`
merge(_:)
` Extension method
Merges elements from all observable sequences from collection into a single observable sequence.
Seealso
merge operator on reactivex.io
Swift
static func merge<Collection>(_ sources: Collection) -> Infallible<Element> where Collection : Collection, Collection.Element == Infallible<Self.Element>
| sources |
Collection of observable sequences to merge.
|
The observable sequence that merges the elements of the observable sequences.
`
merge(_:)
` Extension method
Merges elements from all infallible sequences from array into a single infallible sequence.
Seealso
merge operator on reactivex.io
Swift
static func merge(_ sources: [Infallible<Element>]) -> Infallible<Element>
| sources |
Array of infallible sequences to merge.
|
The infallible sequence that merges the elements of the infallible sequences.
`
merge(_:)
` Extension method
Merges elements from all infallible sequences into a single infallible sequence.
Seealso
merge operator on reactivex.io
Swift
static func merge(_ sources: Infallible<Element>...) -> Infallible<Element>
| sources |
Collection of infallible sequences to merge.
|
The infallible sequence that merges the elements of the infallible sequences.
`
scan(into:accumulator:)
` Extension method
Applies an accumulator function over an observable sequence and returns each intermediate result. The specified seed value is used as the initial accumulator value.
For aggregation behavior with no intermediate results, see reduce.
Seealso
Swift
func scan<Seed>(into seed: Seed, accumulator: @escaping (inout Seed, Element) -> Void)
-> Infallible<Seed>
| seed |
The initial accumulator value.
|
| accumulator |
An accumulator function to be invoked on each element.
|
An observable sequence containing the accumulated values.
`
scan(_:accumulator:)
` Extension method
Applies an accumulator function over an observable sequence and returns each intermediate result. The specified seed value is used as the initial accumulator value.
For aggregation behavior with no intermediate results, see reduce.
Seealso
Swift
func scan<Seed>(_ seed: Seed, accumulator: @escaping (Seed, Element) -> Seed)
-> Infallible<Seed>
| seed |
The initial accumulator value.
|
| accumulator |
An accumulator function to be invoked on each element.
|
An observable sequence containing the accumulated values.
`
startWith(_:)
` Extension method
Prepends a value to an observable sequence.
Seealso
startWith operator on reactivex.io
Swift
func startWith(_ element: Element) -> Infallible<Element>
| element |
Element to prepend to the specified sequence.
|
The source sequence prepended with the specified values.
`
take(until:)
` Extension method
Returns the elements from the source observable sequence until the other observable sequence produces an element.
Seealso
takeUntil operator on reactivex.io
Swift
func take(until other: some InfallibleType)
-> Infallible<Element>
| other |
Observable sequence that terminates propagation of elements of the source sequence.
|
An observable sequence containing the elements of the source sequence up to the point the other sequence interrupted further propagation.
`
take(until:)
` Extension method
Returns the elements from the source observable sequence until the other observable sequence produces an element.
Seealso
takeUntil operator on reactivex.io
Swift
func take(until other: some ObservableType)
-> Infallible<Element>
| other |
Observable sequence that terminates propagation of elements of the source sequence.
|
An observable sequence containing the elements of the source sequence up to the point the other sequence interrupted further propagation.
`
take(until:behavior:)
` Extension method
Returns elements from an observable sequence until the specified condition is true.
Seealso
takeUntil operator on reactivex.io
Swift
func take(
until predicate: @escaping (Element) throws -> Bool,
behavior: TakeBehavior = .exclusive
)
-> Infallible<Element>
| predicate |
A function to test each element for a condition.
|
| behavior |
Whether or not to include the last element matching the predicate. Defaults to exclusive.
|
An observable sequence that contains the elements from the input sequence that occur before the element at which the test passes.
`
take(while:behavior:)
` Extension method
Returns elements from an observable sequence as long as a specified condition is true.
Seealso
takeWhile operator on reactivex.io
Swift
func take(
while predicate: @escaping (Element) throws -> Bool,
behavior: TakeBehavior = .exclusive
)
-> Infallible<Element>
| predicate |
A function to test each element for a condition.
|
An observable sequence that contains the elements from the input sequence that occur before the element at which the test no longer passes.
`
take(_:)
` Extension method
Returns a specified number of contiguous elements from the start of an observable sequence.
Seealso
Swift
func take(_ count: Int) -> Infallible<Element>
| count |
The number of elements to return.
|
An observable sequence that contains the specified number of elements from the start of the input sequence.
`
take(for:scheduler:)
` Extension method
Takes elements for the specified duration from the start of the infallible source sequence, using the specified scheduler to run timers.
Seealso
Swift
func take(for duration: RxTimeInterval, scheduler: SchedulerType)
-> Infallible<Element>
| duration |
Duration for taking elements from the start of the sequence.
|
| scheduler |
Scheduler to run the timer on.
|
An infallible sequence with the elements taken during the specified duration from the start of the source sequence.
`
skip(while:)
` Extension method
Bypasses elements in an infallible sequence as long as a specified condition is true and then returns the remaining elements.
Seealso
skipWhile operator on reactivex.io
Swift
func skip(while predicate: @escaping (Element) throws -> Bool) -> Infallible<Element>
| predicate |
A function to test each element for a condition.
|
An infallible sequence that contains the elements from the input sequence starting at the first element in the linear series that does not pass the test specified by predicate.
`
skip(until:)
` Extension method
Returns the elements from the source infallible sequence that are emitted after the other infallible sequence produces an element.
Seealso
skipUntil operator on reactivex.io
Swift
func skip(until other: some ObservableType)
-> Infallible<Element>
| other |
Infallible sequence that starts propagation of elements of the source sequence.
|
An infallible sequence containing the elements of the source sequence that are emitted after the other sequence emits an item.
`
share(replay:scope:)
` Extension method
Returns an observable sequence that shares a single subscription to the underlying sequence , and immediately upon subscription replays elements in buffer.
This operator is equivalent to:
.whileConnected`` // Each connection will have it's own subject instance to store replay events. // Connections will be isolated from each another. source.multicast(makeSubject: { Replay.create(bufferSize: replay) }).refCount() .forever`` // One subject will store replay events for all connections to source. // Connections won't be isolated from each another. source.multicast(Replay.create(bufferSize: replay)).refCount() It uses optimized versions of the operators for most common operations.
Seealso
shareReplay operator on reactivex.io
Swift
func share(replay: Int = 0, scope: SubjectLifetimeScope = .whileConnected)
-> Infallible<Element>
| replay |
Maximum element count of the replay buffer.
|
| scope |
Lifetime scope of sharing subject. For more information see SubjectLifetimeScope enum.
|
An observable sequence that contains the elements of a sequence produced by multicasting the source sequence.
`
withUnretained(_:resultSelector:)
` Extension method
Provides an unretained, safe to use (i.e. not implicitly unwrapped), reference to an object along with the events emitted by the sequence.
In the case the provided object cannot be retained successfully, the sequence will complete.
Note
Be careful when using this operator in a sequence that has a buffer or replay, for example share(replay: 1), as the sharing buffer will also include the provided object, which could potentially cause a retain cycle.
Swift
func withUnretained<Object: AnyObject, Out>(
_ obj: Object,
resultSelector: @escaping (Object, Element) -> Out
) -> Infallible<Out>
| obj |
The object to provide an unretained reference on.
|
| resultSelector |
A function to combine the unretained referenced on obj and the value of the observable sequence.
|
An observable sequence that contains the result of resultSelector being called with an unretained reference on obj and the values of the original sequence.
`
withUnretained(_:)
` Extension method
Provides an unretained, safe to use (i.e. not implicitly unwrapped), reference to an object along with the events emitted by the sequence.
In the case the provided object cannot be retained successfully, the sequence will complete.
Note
Be careful when using this operator in a sequence that has a buffer or replay, for example share(replay: 1), as the sharing buffer will also include the provided object, which could potentially cause a retain cycle.
Swift
func withUnretained<Object>(_ obj: Object) -> Infallible<(Object, Element)> where Object : AnyObject
| obj |
The object to provide an unretained reference on.
|
An observable sequence of tuples that contains both an unretained reference on obj and the values of the original sequence.
`
withLatestFrom(_:resultSelector:)
` Extension method
Merges two observable sequences into one observable sequence by combining each element from self with the latest element from the second source, if any.
Seealso
combineLatest operator on reactivex.io
Note
Elements emitted by self before the second source has emitted any values will be omitted.
Swift
func withLatestFrom<Source, ResultType>(_ second: Source, resultSelector: @escaping (Element, Source.Element) throws -> ResultType) -> Infallible<ResultType> where Source : InfallibleType
| second |
Second observable source.
|
| resultSelector |
Function to invoke for each element from the self combined with the latest element from the second source, if any.
|
An observable sequence containing the result of combining each element of the self with the latest element from the second source, if any, using the specified result selector function.
`
withLatestFrom(_:)
` Extension method
Merges two observable sequences into one observable sequence by using latest element from the second sequence every time when self emits an element.
Seealso
combineLatest operator on reactivex.io
Note
Elements emitted by self before the second source has emitted any values will be omitted.
Swift
func withLatestFrom<Source>(_ second: Source) -> Infallible<Source.Element> where Source : InfallibleType
| second |
Second observable source.
|
An observable sequence containing the result of combining each element of the self with the latest element from the second source, if any, using the specified result selector function.
`
zip(_:_:resultSelector:)
` Extension method
Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index.
Seealso
Swift
static func zip<E1, E2>(_ source1: Infallible<E1>, _ source2: Infallible<E2>, resultSelector: @escaping (E1, E2) throws -> Element)
-> Infallible<Element>
| resultSelector |
Function to invoke for each series of elements at corresponding indexes in the sources.
|
An observable sequence containing the result of combining elements of the sources using the specified result selector function.
`
zip(_:_:_:resultSelector:)
` Extension method
Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index.
Seealso
Swift
static func zip<E1, E2, E3>(_ source1: Infallible<E1>, _ source2: Infallible<E2>, _ source3: Infallible<E3>, resultSelector: @escaping (E1, E2, E3) throws -> Element)
-> Infallible<Element>
| resultSelector |
Function to invoke for each series of elements at corresponding indexes in the sources.
|
An observable sequence containing the result of combining elements of the sources using the specified result selector function.
`
zip(_:_:_:_:resultSelector:)
` Extension method
Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index.
Seealso
Swift
static func zip<E1, E2, E3, E4>(_ source1: Infallible<E1>, _ source2: Infallible<E2>, _ source3: Infallible<E3>, _ source4: Infallible<E4>, resultSelector: @escaping (E1, E2, E3, E4) throws -> Element)
-> Infallible<Element>
| resultSelector |
Function to invoke for each series of elements at corresponding indexes in the sources.
|
An observable sequence containing the result of combining elements of the sources using the specified result selector function.
`
zip(_:_:_:_:_:resultSelector:)
` Extension method
Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index.
Seealso
Swift
static func zip<E1, E2, E3, E4, E5>(_ source1: Infallible<E1>, _ source2: Infallible<E2>, _ source3: Infallible<E3>, _ source4: Infallible<E4>, _ source5: Infallible<E5>, resultSelector: @escaping (E1, E2, E3, E4, E5) throws -> Element)
-> Infallible<Element>
| resultSelector |
Function to invoke for each series of elements at corresponding indexes in the sources.
|
An observable sequence containing the result of combining elements of the sources using the specified result selector function.
`
zip(_:_:_:_:_:_:resultSelector:)
` Extension method
Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index.
Seealso
Swift
static func zip<E1, E2, E3, E4, E5, E6>(_ source1: Infallible<E1>, _ source2: Infallible<E2>, _ source3: Infallible<E3>, _ source4: Infallible<E4>, _ source5: Infallible<E5>, _ source6: Infallible<E6>, resultSelector: @escaping (E1, E2, E3, E4, E5, E6) throws -> Element)
-> Infallible<Element>
| resultSelector |
Function to invoke for each series of elements at corresponding indexes in the sources.
|
An observable sequence containing the result of combining elements of the sources using the specified result selector function.
`
zip(_:_:_:_:_:_:_:resultSelector:)
` Extension method
Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index.
Seealso
Swift
static func zip<E1, E2, E3, E4, E5, E6, E7>(_ source1: Infallible<E1>, _ source2: Infallible<E2>, _ source3: Infallible<E3>, _ source4: Infallible<E4>, _ source5: Infallible<E5>, _ source6: Infallible<E6>, _ source7: Infallible<E7>, resultSelector: @escaping (E1, E2, E3, E4, E5, E6, E7) throws -> Element)
-> Infallible<Element>
| resultSelector |
Function to invoke for each series of elements at corresponding indexes in the sources.
|
An observable sequence containing the result of combining elements of the sources using the specified result selector function.
`
zip(_:_:_:_:_:_:_:_:resultSelector:)
` Extension method
Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index.
Seealso
Swift
static func zip<E1, E2, E3, E4, E5, E6, E7, E8>(_ source1: Infallible<E1>, _ source2: Infallible<E2>, _ source3: Infallible<E3>, _ source4: Infallible<E4>, _ source5: Infallible<E5>, _ source6: Infallible<E6>, _ source7: Infallible<E7>, _ source8: Infallible<E8>, resultSelector: @escaping (E1, E2, E3, E4, E5, E6, E7, E8) throws -> Element)
-> Infallible<Element>
| resultSelector |
Function to invoke for each series of elements at corresponding indexes in the sources.
|
An observable sequence containing the result of combining elements of the sources using the specified result selector function.
`
subscribe(with:onNext:onCompleted:onDisposed:)
` Extension method
Subscribes an element handler, a completion handler and disposed handler to an observable sequence.
Error callback is not exposed because Infallible can’t error out.
Also, take in an object and provide an unretained, safe to use (i.e. not implicitly unwrapped), reference to it along with the events emitted by the sequence.
Note
If object can’t be retained, none of the other closures will be invoked.
Swift
func subscribe<Object: AnyObject>(
with object: Object,
onNext: ((Object, Element) -> Void)? = nil,
onCompleted: ((Object) -> Void)? = nil,
onDisposed: ((Object) -> Void)? = nil
) -> Disposable
| object |
The object to provide an unretained reference on.
|
| onNext |
Action to invoke for each element in the observable sequence.
|
| onCompleted |
Action to invoke upon graceful termination of the observable sequence. gracefully completed, errored, or if the generation is canceled by disposing subscription)
|
| onDisposed |
Action to invoke upon any type of termination of sequence (if the sequence has gracefully completed, errored, or if the generation is canceled by disposing subscription)
|
Subscription object used to unsubscribe from the observable sequence.
`
subscribe(onNext:onCompleted:onDisposed:)
` Extension method
Subscribes an element handler, a completion handler and disposed handler to an observable sequence.
Error callback is not exposed because Infallible can’t error out.
Swift
func subscribe(
onNext: ((Element) -> Void)? = nil,
onCompleted: (() -> Void)? = nil,
onDisposed: (() -> Void)? = nil
) -> Disposable
| onNext |
Action to invoke for each element in the observable sequence.
|
| onCompleted |
Action to invoke upon graceful termination of the observable sequence. gracefully completed, errored, or if the generation is canceled by disposing subscription)
|
| onDisposed |
Action to invoke upon any type of termination of sequence (if the sequence has gracefully completed, errored, or if the generation is canceled by disposing subscription)
|
Subscription object used to unsubscribe from the observable sequence.
`
subscribe(_:)
` Extension method
Subscribes an event handler to an observable sequence.
Swift
func subscribe(_ on: @escaping (InfallibleEvent<Element>) -> Void) -> Disposable
| on |
Action to invoke for each event in the observable sequence.
|
Subscription object used to unsubscribe from the observable sequence.
Element == Any`
combineLatest(_:_:)
` Extension method
Merges the specified observable sequences into one observable sequence of tuples whenever any of the observable sequences produces an element.
Seealso
combineLatest operator on reactivex.io
Swift
static func combineLatest<O1: InfallibleType, O2: InfallibleType>
(_ source1: O1, _ source2: O2)
-> Infallible<(O1.Element, O2.Element)>
An observable sequence containing the result of combining elements of the sources.
`
combineLatest(_:_:_:)
` Extension method
Merges the specified observable sequences into one observable sequence of tuples whenever any of the observable sequences produces an element.
Seealso
combineLatest operator on reactivex.io
Swift
static func combineLatest<O1: InfallibleType, O2: InfallibleType, O3: InfallibleType>
(_ source1: O1, _ source2: O2, _ source3: O3)
-> Infallible<(O1.Element, O2.Element, O3.Element)>
An observable sequence containing the result of combining elements of the sources.
`
combineLatest(_:_:_:_:)
` Extension method
Merges the specified observable sequences into one observable sequence of tuples whenever any of the observable sequences produces an element.
Seealso
combineLatest operator on reactivex.io
Swift
static func combineLatest<O1: InfallibleType, O2: InfallibleType, O3: InfallibleType, O4: InfallibleType>
(_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4)
-> Infallible<(O1.Element, O2.Element, O3.Element, O4.Element)>
An observable sequence containing the result of combining elements of the sources.
`
combineLatest(_:_:_:_:_:)
` Extension method
Merges the specified observable sequences into one observable sequence of tuples whenever any of the observable sequences produces an element.
Seealso
combineLatest operator on reactivex.io
Swift
static func combineLatest<O1: InfallibleType, O2: InfallibleType, O3: InfallibleType, O4: InfallibleType, O5: InfallibleType>
(_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5)
-> Infallible<(O1.Element, O2.Element, O3.Element, O4.Element, O5.Element)>
An observable sequence containing the result of combining elements of the sources.
`
combineLatest(_:_:_:_:_:_:)
` Extension method
Merges the specified observable sequences into one observable sequence of tuples whenever any of the observable sequences produces an element.
Seealso
combineLatest operator on reactivex.io
Swift
static func combineLatest<O1: InfallibleType, O2: InfallibleType, O3: InfallibleType, O4: InfallibleType, O5: InfallibleType, O6: InfallibleType>
(_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, _ source6: O6)
-> Infallible<(O1.Element, O2.Element, O3.Element, O4.Element, O5.Element, O6.Element)>
An observable sequence containing the result of combining elements of the sources.
`
combineLatest(_:_:_:_:_:_:_:)
` Extension method
Merges the specified observable sequences into one observable sequence of tuples whenever any of the observable sequences produces an element.
Seealso
combineLatest operator on reactivex.io
Swift
static func combineLatest<O1: InfallibleType, O2: InfallibleType, O3: InfallibleType, O4: InfallibleType, O5: InfallibleType, O6: InfallibleType, O7: InfallibleType>
(_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, _ source6: O6, _ source7: O7)
-> Infallible<(O1.Element, O2.Element, O3.Element, O4.Element, O5.Element, O6.Element, O7.Element)>
An observable sequence containing the result of combining elements of the sources.
`
combineLatest(_:_:_:_:_:_:_:_:)
` Extension method
Merges the specified observable sequences into one observable sequence of tuples whenever any of the observable sequences produces an element.
Seealso
combineLatest operator on reactivex.io
Swift
static func combineLatest<O1: InfallibleType, O2: InfallibleType, O3: InfallibleType, O4: InfallibleType, O5: InfallibleType, O6: InfallibleType, O7: InfallibleType, O8: InfallibleType>
(_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, _ source6: O6, _ source7: O7, _ source8: O8)
-> Infallible<(O1.Element, O2.Element, O3.Element, O4.Element, O5.Element, O6.Element, O7.Element, O8.Element)>
An observable sequence containing the result of combining elements of the sources.
Element: Equatable`
distinctUntilChanged()
` Extension method
Returns an observable sequence that contains only distinct contiguous elements according to equality operator.
Seealso
distinct operator on reactivex.io
Swift
func distinctUntilChanged()
-> Infallible<Element>
An observable sequence only containing the distinct contiguous elements, based on equality operator, from the source sequence.