Partager 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 8, Windows 7, Windows Server 2012, Windows Server 2008 R2

Version Information

F# Core Library Versions

Supported in: 2.0, 4.0, Portable

See Also

Reference

Control.Observable Module (F#)

Microsoft.FSharp.Control Namespace (F#)