Skip to content

,System.IObservable{--1})}

ObservableEx.WithLatestFrom(IObservable, IObservable) method

Defined in

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

Applies to

netstandard2.0

public static IObservable<(TFirst First, TSecond Second)> WithLatestFrom<TFirst, TSecond>(this IObservable<TFirst> first, IObservable<TSecond> second)

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.

Type parameters

NameDescription
TFirstThe type of the elements in the first source sequence.
TSecondThe type of the elements in the second source sequence.

Parameters

NameTypeDescription
firstIObservableFirst observable source.
secondIObservableSecond observable source.

Returns: IObservable<(TFirst First, TSecond Second)> -- An observable sequence containing the result of combining each element of the first source with the latest element from the second source, if any, as a tuple value.

Exceptions

TypeCondition
System.ArgumentNullExceptionfirst or second is null.