Skip to content

,System.IDisposable})} ,System.IDisposable},System.Boolean)}

Signal.CreateWithState(TState, Func, IDisposable>) method

Defined in

Type: Signal Namespace: ReactiveUI.Primitives.Reactive.Signals Assembly: ReactiveUI.Primitives.Reactive.dll

Applies to

net10.0, net10.0-browserwasm1.0, net10.0-desktop1.0, net9.0, net9.0-browserwasm1.0, net9.0-desktop1.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, net462, net481

Overloads

  • 1. public static IObservable<T> CreateWithState<T, TState>(TState state, Func<TState, IObserver<T>, IDisposable> subscribe)
  • 2. public static IObservable<T> CreateWithState<T, TState>(TState state, Func<TState, IObserver<T>, IDisposable> subscribe, bool isRequiredSubscribeOnCurrentThread)

1. Overload

public static IObservable<T> CreateWithState<T, TState>(TState state, Func<TState, IObserver<T>, IDisposable> subscribe)

View source

Summary: Create anonymous Signals. Observer has exception durability. This is recommended for make operator and event, generating a HotSignals.

Type parameters

NameDescription
TThe type.
TStateThe type of the state.

Parameters

NameTypeDescription
stateTStateThe state.
subscribeFunc, IDisposable>The subscribe.

Returns: IObservable -- An Signals.

Exceptions

TypeCondition
System.ArgumentNullExceptionsubscribe.
System.ArgumentNullExceptionsubscribe is null.

2. Overload

public static IObservable<T> CreateWithState<T, TState>(TState state, Func<TState, IObserver<T>, IDisposable> subscribe, bool isRequiredSubscribeOnCurrentThread)

View source

Summary: Create anonymous Signals. Observer has exception durability. This is recommended for make operator and event, generating a HotSignals.

Type parameters

NameDescription
TThe type.
TStateThe type of the state.

Parameters

NameTypeDescription
stateTStateThe state.
subscribeFunc, IDisposable>The subscribe.
isRequiredSubscribeOnCurrentThreadboolif set to true [is required subscribe on current thread].

Returns: IObservable -- An Signals.

Exceptions

TypeCondition
System.ArgumentNullExceptionsubscribe.
System.ArgumentNullExceptionsubscribe is null.