Skip to content

)}

Observer.Checked(IObserver) method

Defined in

Type: Observer Namespace: System.Reactive Assembly: System.Reactive.dll

Applies to

netstandard2.0

public static IObserver<T> Checked<T>(this IObserver<T> observer)

Summary: Checks access to the observer for grammar violations. This includes checking for multiple OnError or OnCompleted calls, as well as reentrancy in any of the observer methods. If a violation is detected, an InvalidOperationException is thrown from the offending observer method call.

Type parameters

NameDescription
TThe type of the elements received by the source observer.

Parameters

NameTypeDescription
observerIObserverThe observer whose callback invocations should be checked for grammar violations.

Returns: IObserver -- An observer that checks callbacks invocations against the observer grammar and, if the checks pass, forwards those to the specified observer.

Exceptions

TypeCondition
System.ArgumentNullExceptionobserver is null.