Skip to content

)} ,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

NameDescription
TThe type of the elements received by the observer.

Parameters

NameTypeDescription
onNextActionObserver's OnNext action implementation.

Returns: IObserver -- The observer object implemented using the given actions.

Exceptions

TypeCondition
System.ArgumentNullExceptiononNext 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

NameDescription
TThe type of the elements received by the observer.

Parameters

NameTypeDescription
onNextActionObserver's OnNext action implementation.
onErrorActionObserver's OnError action implementation.

Returns: IObserver -- The observer object implemented using the given actions.

Exceptions

TypeCondition
System.ArgumentNullExceptiononNext 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

NameDescription
TThe type of the elements received by the observer.

Parameters

NameTypeDescription
onNextActionObserver's OnNext action implementation.
onCompletedActionObserver's OnCompleted action implementation.

Returns: IObserver -- The observer object implemented using the given actions.

Exceptions

TypeCondition
System.ArgumentNullExceptiononNext 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

NameDescription
TThe type of the elements received by the observer.

Parameters

NameTypeDescription
onNextActionObserver's OnNext action implementation.
onErrorActionObserver's OnError action implementation.
onCompletedActionObserver's OnCompleted action implementation.

Returns: IObserver -- The observer object implemented using the given actions.

Exceptions

TypeCondition
System.ArgumentNullExceptiononNext or onError or onCompleted is null.