Skip to content

,System.IObserver{--0},System.Boolean[])} },System.IObserver{System.Nullable{--0}},System.Boolean[])} ,System.Action{--0},System.Action{System.Exception},System.Boolean[])} },System.Action{System.Nullable{--0}},System.Action{System.Exception},System.Boolean[])} ,System.Action{--0},System.Action{System.Exception},System.Action,System.Boolean[])} },System.Action{System.Nullable{--0}},System.Action{System.Exception},System.Action,System.Boolean[])} ,System.Action{System.Exception},System.Boolean[])} },System.Action{System.Exception},System.Boolean[])} ,System.Action{System.Exception},System.Action,System.Boolean[])} },System.Action{System.Exception},System.Action,System.Boolean[])} ,System.IObserver{--0})} ,System.Action{--0},System.Action{System.Exception})} ,System.Action{--0},System.Action{System.Exception},System.Action)} ,System.Action{System.Exception})} ,System.Action{System.Exception},System.Action)}

LinqExtensions.SubscribeSafe(IObservable, IObserver, bool[]) method

Defined in

Type: LinqExtensions Namespace: ReactiveUI.Primitives.Reactive Assembly: ReactiveUI.Primitives.Reactive.dll

Applies to

net10.0, net10.0-android36.0, net10.0-ios26.0, net10.0-macos26.0, net10.0-tvos26.0, net10.0-maccatalyst26.0, net10.0-browserwasm1.0, net10.0-desktop1.0, net9.0, net9.0-desktop1.0, net9.0-browserwasm1.0, net8.0, net8.0-ios17.5, net8.0-maccatalyst17.5, net8.0-macos14.2, net8.0-macos14.5, net8.0-tvos17.2, netstandard2.1, net481, net471, net462

Overloads

  • 1. public static IDisposable SubscribeSafe<T>(IObservable<T?> source, IObserver<T> observer, params bool[] allowNullable) where T : class
  • 2. public static IDisposable SubscribeSafe<T>(IObservable<T?> source, IObserver<T?> observer, params bool[] allowNullable) where T : struct
  • 3. public static IDisposable SubscribeSafe<T>(IObservable<T?> source, Action<T> onNext, Action<Exception> onError, params bool[] allowNullable) where T : class
  • 4. public static IDisposable SubscribeSafe<T>(IObservable<T?> source, Action<T?> onNext, Action<Exception> onError, params bool[] allowNullable) where T : struct
  • 5. public static IDisposable SubscribeSafe<T>(IObservable<T?> source, Action<T> onNext, Action<Exception> onError, Action onCompleted, params bool[] allowNullable) where T : class
  • 6. public static IDisposable SubscribeSafe<T>(IObservable<T?> source, Action<T?> onNext, Action<Exception> onError, Action onCompleted, params bool[] allowNullable) where T : struct
  • 7. public static IDisposable SubscribeSafe<T>(IObservable<T?> source, Action<Exception> onError, params bool[] allowNullable) where T : class
  • 8. public static IDisposable SubscribeSafe<T>(IObservable<T?> source, Action<Exception> onError, params bool[] allowNullable) where T : struct
  • 9. public static IDisposable SubscribeSafe<T>(IObservable<T?> source, Action<Exception> onError, Action onCompleted, params bool[] allowNullable) where T : class
  • 10. public static IDisposable SubscribeSafe<T>(IObservable<T?> source, Action<Exception> onError, Action onCompleted, params bool[] allowNullable) where T : struct
  • 11. public static IDisposable SubscribeSafe<T>(this IObservable<T> source, IObserver<T> observer) where T : notnull
  • 12. public static IDisposable SubscribeSafe<T>(this IObservable<T> source, Action<T> onNext, Action<Exception> onError) where T : notnull
  • 13. public static IDisposable SubscribeSafe<T>(this IObservable<T> source, Action<T> onNext, Action<Exception> onError, Action onCompleted) where T : notnull
  • 14. public static IDisposable SubscribeSafe<T>(this IObservable<T> source, Action<Exception> onError) where T : notnull
  • 15. public static IDisposable SubscribeSafe<T>(this IObservable<T> source, Action<Exception> onError, Action onCompleted) where T : notnull

1. Overload

public static IDisposable SubscribeSafe<T>(IObservable<T?> source, IObserver<T> observer, params bool[] allowNullable) where T : class

View source

Summary: Subscribes a nullable reference observer with downstream exception protection from static-call syntax.

Type parameters

NameDescription
TThe non-nullable reference value type.

Parameters

NameTypeDescription
sourceIObservableThe source sequence.
observerIObserverThe observer to subscribe.
params allowNullablebool[]Reserved for nullable overload resolution.

Returns: IDisposable -- A disposable that cancels the subscription.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource or observer is null.

2. Overload

public static IDisposable SubscribeSafe<T>(IObservable<T?> source, IObserver<T?> observer, params bool[] allowNullable) where T : struct

View source

Summary: Subscribes a nullable value observer with downstream exception protection from static-call syntax.

Type parameters

NameDescription
TThe non-nullable value type.

Parameters

NameTypeDescription
sourceIObservableThe source sequence.
observerIObserverThe observer to subscribe.
params allowNullablebool[]Reserved for nullable overload resolution.

Returns: IDisposable -- A disposable that cancels the subscription.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource or observer is null.

3. Overload

public static IDisposable SubscribeSafe<T>(IObservable<T?> source, Action<T> onNext, Action<Exception> onError, params bool[] allowNullable) where T : class

View source

Summary: Subscribes nullable reference callbacks with downstream exception protection from static-call syntax.

Type parameters

NameDescription
TThe non-nullable reference value type.

Parameters

NameTypeDescription
sourceIObservableThe source sequence.
onNextActionThe action to invoke for each value.
onErrorActionThe action to invoke for an error.
params allowNullablebool[]Reserved for nullable overload resolution.

Returns: IDisposable -- A disposable that cancels the subscription.

Exceptions

TypeCondition
System.ArgumentNullExceptionA required argument is null.

4. Overload

public static IDisposable SubscribeSafe<T>(IObservable<T?> source, Action<T?> onNext, Action<Exception> onError, params bool[] allowNullable) where T : struct

View source

Summary: Subscribes nullable value callbacks with downstream exception protection from static-call syntax.

Type parameters

NameDescription
TThe non-nullable value type.

Parameters

NameTypeDescription
sourceIObservableThe source sequence.
onNextActionThe action to invoke for each value.
onErrorActionThe action to invoke for an error.
params allowNullablebool[]Reserved for nullable overload resolution.

Returns: IDisposable -- A disposable that cancels the subscription.

Exceptions

TypeCondition
System.ArgumentNullExceptionA required argument is null.

5. Overload

public static IDisposable SubscribeSafe<T>(IObservable<T?> source, Action<T> onNext, Action<Exception> onError, Action onCompleted, params bool[] allowNullable) where T : class

View source

Summary: Subscribes nullable reference callbacks with downstream exception protection from static-call syntax.

Type parameters

NameDescription
TThe non-nullable reference value type.

Parameters

NameTypeDescription
sourceIObservableThe source sequence.
onNextActionThe action to invoke for each value.
onErrorActionThe action to invoke for an error.
onCompletedActionThe action to invoke when the sequence completes.
params allowNullablebool[]Reserved for nullable overload resolution.

Returns: IDisposable -- A disposable that cancels the subscription.

Exceptions

TypeCondition
System.ArgumentNullExceptionA required argument is null.

6. Overload

public static IDisposable SubscribeSafe<T>(IObservable<T?> source, Action<T?> onNext, Action<Exception> onError, Action onCompleted, params bool[] allowNullable) where T : struct

View source

Summary: Subscribes nullable value callbacks with downstream exception protection from static-call syntax.

Type parameters

NameDescription
TThe non-nullable value type.

Parameters

NameTypeDescription
sourceIObservableThe source sequence.
onNextActionThe action to invoke for each value.
onErrorActionThe action to invoke for an error.
onCompletedActionThe action to invoke when the sequence completes.
params allowNullablebool[]Reserved for nullable overload resolution.

Returns: IDisposable -- A disposable that cancels the subscription.

Exceptions

TypeCondition
System.ArgumentNullExceptionA required argument is null.

7. Overload

public static IDisposable SubscribeSafe<T>(IObservable<T?> source, Action<Exception> onError, params bool[] allowNullable) where T : class

View source

Summary: Subscribes nullable reference terminal callbacks with downstream exception protection from static-call syntax.

Type parameters

NameDescription
TThe non-nullable reference value type.

Parameters

NameTypeDescription
sourceIObservableThe source sequence.
onErrorActionThe action to invoke for an error.
params allowNullablebool[]Reserved for nullable overload resolution.

Returns: IDisposable -- A disposable that cancels the subscription.

Exceptions

TypeCondition
System.ArgumentNullExceptionA required argument is null.

8. Overload

public static IDisposable SubscribeSafe<T>(IObservable<T?> source, Action<Exception> onError, params bool[] allowNullable) where T : struct

View source

Summary: Subscribes nullable value terminal callbacks with downstream exception protection from static-call syntax.

Type parameters

NameDescription
TThe non-nullable value type.

Parameters

NameTypeDescription
sourceIObservableThe source sequence.
onErrorActionThe action to invoke for an error.
params allowNullablebool[]Reserved for nullable overload resolution.

Returns: IDisposable -- A disposable that cancels the subscription.

Exceptions

TypeCondition
System.ArgumentNullExceptionA required argument is null.

9. Overload

public static IDisposable SubscribeSafe<T>(IObservable<T?> source, Action<Exception> onError, Action onCompleted, params bool[] allowNullable) where T : class

View source

Summary: Subscribes nullable reference terminal callbacks with downstream exception protection from static-call syntax.

Type parameters

NameDescription
TThe non-nullable reference value type.

Parameters

NameTypeDescription
sourceIObservableThe source sequence.
onErrorActionThe action to invoke for an error.
onCompletedActionThe action to invoke when the sequence completes.
params allowNullablebool[]Reserved for nullable overload resolution.

Returns: IDisposable -- A disposable that cancels the subscription.

Exceptions

TypeCondition
System.ArgumentNullExceptionA required argument is null.

10. Overload

public static IDisposable SubscribeSafe<T>(IObservable<T?> source, Action<Exception> onError, Action onCompleted, params bool[] allowNullable) where T : struct

View source

Summary: Subscribes nullable value terminal callbacks with downstream exception protection from static-call syntax.

Type parameters

NameDescription
TThe non-nullable value type.

Parameters

NameTypeDescription
sourceIObservableThe source sequence.
onErrorActionThe action to invoke for an error.
onCompletedActionThe action to invoke when the sequence completes.
params allowNullablebool[]Reserved for nullable overload resolution.

Returns: IDisposable -- A disposable that cancels the subscription.

Exceptions

TypeCondition
System.ArgumentNullExceptionA required argument is null.

11. Overload

public static IDisposable SubscribeSafe<T>(this IObservable<T> source, IObserver<T> observer) where T : notnull

View source

Type parameters

NameDescription
T--

Parameters

NameTypeDescription
sourceIObservable--
observerIObserver--

Returns: IDisposable

12. Overload

public static IDisposable SubscribeSafe<T>(this IObservable<T> source, Action<T> onNext, Action<Exception> onError) where T : notnull

View source

Type parameters

NameDescription
T--

Parameters

NameTypeDescription
sourceIObservable--
onNextAction--
onErrorAction--

Returns: IDisposable

13. Overload

public static IDisposable SubscribeSafe<T>(this IObservable<T> source, Action<T> onNext, Action<Exception> onError, Action onCompleted) where T : notnull

View source

Type parameters

NameDescription
T--

Parameters

NameTypeDescription
sourceIObservable--
onNextAction--
onErrorAction--
onCompletedAction--

Returns: IDisposable

14. Overload

public static IDisposable SubscribeSafe<T>(this IObservable<T> source, Action<Exception> onError) where T : notnull

View source

Type parameters

NameDescription
T--

Parameters

NameTypeDescription
sourceIObservable--
onErrorAction--

Returns: IDisposable

15. Overload

public static IDisposable SubscribeSafe<T>(this IObservable<T> source, Action<Exception> onError, Action onCompleted) where T : notnull

View source

Type parameters

NameDescription
T--

Parameters

NameTypeDescription
sourceIObservable--
onErrorAction--
onCompletedAction--

Returns: IDisposable