)} ,System.Action{System.Exception})} ,System.Action)} ,System.Action{System.Exception},System.Action)}
Observer.Create(Action) method¶
Defined in
Type: Observer
Namespace: System.Reactive
Assembly: System.Reactive.dll
Applies to
netstandard2.0
Overloads¶
- 1.
public static IObserver<T> Create<T>(Action<T> onNext) - 2.
public static IObserver<T> Create<T>(Action<T> onNext, Action<Exception> onError) - 3.
public static IObserver<T> Create<T>(Action<T> onNext, Action onCompleted) - 4.
public static IObserver<T> Create<T>(Action<T> onNext, Action<Exception> onError, Action onCompleted)
1. Overload¶
public static IObserver<T> Create<T>(Action<T> onNext)
Summary: Creates an observer from the specified OnNext action.
Type parameters
| Name | Description |
|---|---|
T | The type of the elements received by the observer. |
Parameters
| Name | Type | Description |
|---|---|---|
onNext | Action | Observer's OnNext action implementation. |
Returns: IObserver
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | onNext is null. |
2. Overload¶
public static IObserver<T> Create<T>(Action<T> onNext, Action<Exception> onError)
Summary: Creates an observer from the specified OnNext and OnError actions.
Type parameters
| Name | Description |
|---|---|
T | The type of the elements received by the observer. |
Parameters
| Name | Type | Description |
|---|---|---|
onNext | Action | Observer's OnNext action implementation. |
onError | Action | Observer's OnError action implementation. |
Returns: IObserver
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | onNext or onError is null. |
3. Overload¶
public static IObserver<T> Create<T>(Action<T> onNext, Action onCompleted)
Summary: Creates an observer from the specified OnNext and OnCompleted actions.
Type parameters
| Name | Description |
|---|---|
T | The type of the elements received by the observer. |
Parameters
| Name | Type | Description |
|---|---|---|
onNext | Action | Observer's OnNext action implementation. |
onCompleted | Action | Observer's OnCompleted action implementation. |
Returns: IObserver
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | onNext or onCompleted is null. |
4. Overload¶
public static IObserver<T> Create<T>(Action<T> onNext, Action<Exception> onError, Action onCompleted)
Summary: Creates an observer from the specified OnNext, OnError, and OnCompleted actions.
Type parameters
| Name | Description |
|---|---|
T | The type of the elements received by the observer. |
Parameters
| Name | Type | Description |
|---|---|---|
onNext | Action | Observer's OnNext action implementation. |
onError | Action | Observer's OnError action implementation. |
onCompleted | Action | Observer's OnCompleted action implementation. |
Returns: IObserver
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | onNext or onError or onCompleted is null. |