Observable.CombineLatest<TFirst, TSecond, TResult> Method

Merges two observable sequences into one observable sequence by using the selector function whenever one of the observable sequences produces an element.

Namespace:  System.Reactive.Linq
Assembly:  System.Reactive (in System.Reactive.dll)


<ExtensionAttribute> _
Public Shared Function CombineLatest(Of TFirst, TSecond, TResult) ( _
    first As IObservable(Of TFirst), _
    second As IObservable(Of TSecond), _
    resultSelector As Func(Of TFirst, TSecond, TResult) _
) As IObservable(Of TResult)
Dim first As IObservable(Of TFirst)
Dim second As IObservable(Of TSecond)
Dim resultSelector As Func(Of TFirst, TSecond, TResult)
Dim returnValue As IObservable(Of TResult)

returnValue = first.CombineLatest(second, _
public static IObservable<TResult> CombineLatest<TFirst, TSecond, TResult>(
    this IObservable<TFirst> first,
    IObservable<TSecond> second,
    Func<TFirst, TSecond, TResult> resultSelector
generic<typename TFirst, typename TSecond, typename TResult>
static IObservable<TResult>^ CombineLatest(
    IObservable<TFirst>^ first, 
    IObservable<TSecond>^ second, 
    Func<TFirst, TSecond, TResult>^ resultSelector
static member CombineLatest : 
        first:IObservable<'TFirst> * 
        second:IObservable<'TSecond> * 
        resultSelector:Func<'TFirst, 'TSecond, 'TResult> -> IObservable<'TResult> 
JScript does not support generic types and methods.

Type Parameters

  • TFirst
    The first type.
  • TSecond
    The second type.
  • TResult
    The type of result.


  • resultSelector
    Type: System.Func<TFirst, TSecond, TResult>
    The function to invoke whenever either of the sources produces an element.

Return Value

Type: System.IObservable<TResult>
An observable sequence containing the result of combining elements of both sources using the specified result selector function.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IObservable<TFirst>. When you use instance method syntax to call this method, omit the first parameter. For more information, see or .

See Also


Observable Class

System.Reactive.Linq Namespace