Observer.ToObserver(Action>) method¶
Defined in
Type: Observer
Namespace: System.Reactive
Assembly: System.Reactive.dll
Applies to
netstandard2.0
Overloads¶
- 1.
public static IObserver<T> ToObserver<T>(this Action<Notification<T>> handler) - 2.
public static IObserver<T> ToObserver<T>(this IProgress<T> progress)
1. Overload¶
public static IObserver<T> ToObserver<T>(this Action<Notification<T>> handler)
Summary: Creates an observer from a notification callback.
Type parameters
| Name | Description |
|---|---|
T | The type of the elements received by the observer. |
Parameters
| Name | Type | Description |
|---|---|---|
handler | Action | Action that handles a notification. |
Returns: IObserver
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | handler is null. |
2. Overload¶
public static IObserver<T> ToObserver<T>(this IProgress<T> progress)
Summary: Converts a progress object to an observer.
Type parameters
| Name | Description |
|---|---|
T | The type of the progress objects received by the progress reporter. |
Parameters
| Name | Type | Description |
|---|---|---|
progress | IProgress | The progress object to convert. |
Returns: IObserver
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | progress is null. |