Share via


Observable.split<'T,'U1,'U2> Function (F#)

Returns two observables which split the observations of the source by the given function. The first will trigger observations for which the splitter returns Choice1Of2. The second will trigger observations y for which the splitter returns Choice2Of2. 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.

Namespace/Module Path: Microsoft.FSharp.Control.Observable

Assembly: FSharp.Core (in FSharp.Core.dll)

// Signature:
Observable.split : ('T -> Choice<'U1,'U2>) -> IObservable<'T> -> IObservable<'U1> * IObservable<'U2>

// Usage:
Observable.split splitter source

Parameters

  • splitter
    Type: 'T -> Choice<'U1,'U2>

    The function that takes an observation and transforms it into one of the two output Choice types.

  • source
    Type: IObservable<'T>

    The input Observable.

Return Value

A tuple of Observables. The first triggers when splitter returns Choice1of2 and the second triggers when splitter returns Choice2of2.

Remarks

This function is named Split in compiled assemblies. If you are accessing the function from a language other than F#, or through reflection, use this name.

Platforms

Windows 7, Windows Vista SP2, Windows XP SP3, Windows XP x64 SP2, Windows Server 2008 R2, Windows Server 2008 SP2, Windows Server 2003 SP2

Version Information

F# Runtime

Supported in: 2.0, 4.0

Silverlight

Supported in: 3

See Also

Reference

Control.Observable Module (F#)

Microsoft.FSharp.Control Namespace (F#)