Header menu logo FSharp.Core.Fluent

ObservableExtensions Module

Fluent extension operations on observables.

Type extensions

Type extension Description

this.add callback

Full Usage: this.add callback

Parameters:
    callback : 'T -> unit - The function to be called on each observation.

Modifiers: inline

Creates an observer which permanently subscribes to the given observable and which calls the given function for each observation.

Extended Type: IObservable

callback : 'T -> unit

The function to be called on each observation.

this.choose chooser

Full Usage: this.choose chooser

Parameters:
    chooser : '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 x for which the splitter returns Some x. The returned object also propagates all errors arising from the source and completes when the source completes.

Extended Type: IObservable

chooser : '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.

this.filter predicate

Full Usage: this.filter predicate

Parameters:
    predicate : '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: IObservable

predicate : '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.

this.map mapping

Full Usage: this.map mapping

Parameters:
    mapping : '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

Returns an observable which transforms the observations of the source by the given function. The transformation function 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: IObservable

mapping : 'T -> 'U

The function applied to observations from the source.

Returns: IObservable<'U>

An Observable of the type specified by mapping.

this.merge obs2

Full Usage: this.merge obs2

Parameters:
Returns: IObservable<'T> An Observable that propagates information from both sources.
Modifiers: inline

Returns an observable for the merged observations from the sources. The returned object propagates success and error values arising from either source and completes when both the sources have completed.

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: IObservable

obs2 : IObservable<'T>

The second Observable.

Returns: IObservable<'T>

An Observable that propagates information from both sources.

this.pairwise ()

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: IObservable

() : unit
Returns: IObservable<'T * 'T>

An Observable that triggers on successive pairs of observations from the input Observable.

this.partition predicate

Full Usage: this.partition predicate

Parameters:
    predicate : '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: IObservable

predicate : '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.

this.scan (state, collector)

Full Usage: this.scan (state, collector)

Parameters:
    state : '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: IObservable

state : '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.

this.split splitter

Full Usage: this.split splitter

Parameters:
    splitter : '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 x for which the splitter returns Choice1Of2 x. The second will trigger observations y for which the splitter returns Choice2Of2 y The splitter is executed once for each subscribed observer. Both also propagate error observations arising from the source and each completes when the source completes.

Extended Type: IObservable

splitter : '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.

this.subscribe callback

Full Usage: this.subscribe callback

Parameters:
    callback : 'T -> unit - The function to be called on each observation.

Returns: IDisposable An object that will remove the callback if disposed.
Modifiers: inline

Creates an observer which subscribes to the given observable and which calls the given function for each observation.

Extended Type: IObservable

callback : 'T -> unit

The function to be called on each observation.

Returns: IDisposable

An object that will remove the callback if disposed.

Type something to start searching.