Observer.ToObserver<T> Method

Creates an observer from a notification callback.

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

public static IObserver<T> ToObserver<T>(
	this Action<Notification<T>> handler

Type Parameters


The observer argument type.


Type: System.Action<Notification<T>>
The action that handles a notification.

Return Value

Type: System.IObserver<T>
The observer object that invokes the specified handler using a notification corresponding to each message it receives.

Usage Note

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