ObservableExtensions Module
Fluent extension operations on observables.
Type extensions
Type extension | Description |
Full Usage:
this.add callback
Parameters:
'T -> unit
-
The function to be called on each observation.
Modifiers: inline |
|
Full Usage:
this.choose chooser
Parameters:
'T -> 'U option
-
The function that returns Some for observations to be propagated
and None for observations to ignore.
Returns: IObservable<'U>
An Observable that only propagates some of the observations from the source.
Modifiers: inline Type parameters: 'U |
Returns an observable which chooses a projection of observations from the source
using the given function. The returned object will trigger observations
Extended Type:
|
Full Usage:
this.filter predicate
Parameters:
'T -> bool
-
The function to apply to observations to determine if it should
be kept.
Returns: IObservable<'T>
An Observable that filters observations based on filter .
Modifiers: inline |
Returns an observable which filters the observations of the source by the given function. The observable will see only those observations for which the predicate returns true. The predicate is executed once for each subscribed observer. The returned object also propagates error observations arising from the source and completes when the source completes.
Extended Type:
|
Full Usage:
this.map mapping
Parameters:
'T -> 'U
-
The function applied to observations from the source.
Returns: IObservable<'U>
An Observable of the type specified by mapping .
Modifiers: inline Type parameters: 'U |
Extended Type:
|
Full Usage:
this.merge obs2
Parameters:
IObservable<'T>
-
The second Observable.
Returns: IObservable<'T>
An Observable that propagates information from both sources.
Modifiers: inline |
For each observer, the registered intermediate observing object is not thread safe. That is, observations arising from the sources must not be triggered concurrently on different threads.
Extended Type:
|
Full Usage:
this.pairwise ()
Parameters:
unit
Returns: IObservable<'T * 'T>
An Observable that triggers on successive pairs of observations from the input Observable.
Modifiers: inline |
Returns a new observable that triggers on the second and subsequent triggerings of the input observable. The Nth triggering of the input observable passes the arguments from the N-1th and Nth triggering as a pair. The argument passed to the N-1th triggering is held in hidden internal state until the Nth triggering occurs. For each observer, the registered intermediate observing object is not thread safe. That is, observations arising from the source must not be triggered concurrently on different threads.
Extended Type:
|
Full Usage:
this.partition predicate
Parameters:
'T -> bool
-
The function to determine which output Observable will trigger
a particular observation.
Returns: IObservable<'T> * IObservable<'T>
A tuple of Observables. The first triggers when the predicate returns true, and
the second triggers when the predicate returns false.
Modifiers: inline |
Returns two observables which partition the observations of the source by the given function. The first will trigger observations for those values for which the predicate returns true. The second will trigger observations for those values where the predicate returns false. The predicate is executed once for each subscribed observer. Both also propagate all error observations arising from the source and each completes when the source completes.
Extended Type:
|
Full Usage:
this.scan (state, collector)
Parameters:
'U
-
The initial state.
collector : 'U -> 'T -> 'U
-
The function to update the state with each observation.
Returns: IObservable<'U>
An Observable that triggers on the updated state values.
Modifiers: inline Type parameters: 'U |
Returns an observable which, for each observer, allocates an item of state and applies the given accumulating function to successive values arising from the input. The returned object will trigger observations for each computed state value, excluding the initial value. The returned object propagates all errors arising from the source and completes when the source completes. For each observer, the registered intermediate observing object is not thread safe. That is, observations arising from the source must not be triggered concurrently on different threads.
Extended Type:
|
Full Usage:
this.split splitter
Parameters:
'T -> Choice<'U1, 'U2>
-
The function that takes an observation an transforms
it into one of the two output Choice types.
Returns: IObservable<'U1> * IObservable<'U2>
A tuple of Observables. The first triggers when splitter returns Choice1of2
and the second triggers when splitter returns Choice2of2.
Modifiers: inline Type parameters: 'U1, 'U2 |
Returns two observables which split the observations of the source by the
given function. The first will trigger observations
Extended Type:
|
Full Usage:
this.subscribe callback
Parameters:
'T -> unit
-
The function to be called on each observation.
Returns: IDisposable
An object that will remove the callback if disposed.
Modifiers: inline |
Extended Type:
|