Skip to content

,System.IObservable{--1},System.Linq.Expressions.Expression})}

Qbservable.WithLatestFrom(IQbservable, IObservable, Expression>) method

Defined in

Type: Qbservable Namespace: System.Reactive.Linq Assembly: System.Reactive.dll

Applies to

netstandard2.0

public static IQbservable<TResult> WithLatestFrom<TFirst, TSecond, TResult>(this IQbservable<TFirst> first, IObservable<TSecond> second, Expression<Func<TFirst, TSecond, TResult>> resultSelector)

Summary: Merges two observable sequences into one observable sequence by combining each element from the first source with the latest element from the second source, if any. Starting from Rx.NET 4.0, this will subscribe to second before subscribing to first to have a latest element readily available in case first emits an element right away.

Type parameters

NameDescription
TFirstThe type of the elements in the first source sequence.
TSecondThe type of the elements in the second source sequence.
TResultThe type of the elements in the result sequence, returned by the selector function.

Parameters

NameTypeDescription
first[IQbservable](#First observable source.
secondIObservableSecond observable source.
resultSelectorExpression>Function to invoke for each element from the first source combined with the latest element from the second source, if any.

Returns: IQbservable -- An observable sequence containing the result of combining each element of the first source with the latest element from the second source, if any, using the specified result selector function.

Exceptions

TypeCondition
System.ArgumentNullExceptionfirst or second or resultSelector is null.