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
Element
filteringnil
and emitting only distinct contiguous elements.
filterNil()
Unwraps and filters out
nil
elements.
- returns:
Observable
of sourceObservable
’s elements, withnil
elements filtered out.
withStateChanges(in:that:)
public func withStateChanges<T>(in stateComponent: KeyPath<Element, T>, that componentProperty: KeyPath<T, Bool>) -> Observable<T>
Maps from a
StateType
property to create anObservable
that contains the filtered property and all its changes.