EXTENSION
ObservableType
Methods
filterOne(_:)
public func filterOne(_ condition: @escaping (Element) -> Bool) -> Observable<Element>
Take the first element that matches the filter function.
- Parameter fn: Filter closure.
- Returns: The first element that matches the filter.
Parameters
| Name | Description |
|---|---|
| fn | Filter closure. |
filter(_:)
public func filter(_ keyPath: KeyPath<Element, Bool>) -> Observable<Element>
map(_:)
public func map<T>(_ keyPath: KeyPath<Element, T>) -> Observable<T>
one()
public func one() -> Observable<Element>
skippingCurrent()
public func skippingCurrent() -> Observable<Element>
select(_:)
public func select<T: OptionalType>(_ keyPath: KeyPath<Element, T>) -> Observable<T.Wrapped> where T.Wrapped: Equatable
Selects a property component from an
Elementfilteringniland emitting only distinct contiguous elements.
filterNil()
Unwraps and filters out
nilelements.
- returns:
Observableof sourceObservable’s elements, withnilelements filtered out.
withStateChanges(in:that:)
public func withStateChanges<T>(in stateComponent: KeyPath<Element, T>, that componentProperty: KeyPath<T, Bool>) -> Observable<T>
Maps from a
StateTypeproperty to create anObservablethat contains the filtered property and all its changes.