Show / Hide Table of Contents

Class SharedStateReactiveExtensions

Extension methods on ISharedState for conversion from and to System.Reactive observables.

Inheritance
System.Object
SharedStateReactiveExtensions
Namespace: Cortex.Net.Rx
Assembly: Cortex.Net.dll
Syntax
public static class SharedStateReactiveExtensions : object

Methods

| Improve this Doc View Source

AsObservable<T>(ISharedState, Func<T>, Boolean)

Converts an expression to observe into an .

Declaration
public static IObservable<T> AsObservable<T>(this ISharedState sharedState, Func<T> expressionToObserve, bool fireImmediately = false)
Parameters
Type Name Description
ISharedState sharedState

The shared state to use.

Func<T> expressionToObserve

The expression to observe.

System.Boolean fireImmediately

Whether to fire immediately.

Returns
Type Description
Cortex.Net.IObservable<T>

An instance that can be used to observe.

Type Parameters
Name Description
T

The type to observe.

Remarks

The provided expression is tracked by Cortex.Net as long as there are subscribers, automatically emitting when new values become available. The expressions respect(trans)actions.

| Improve this Doc View Source

FromObservable<T>(ISharedState, IObservable<T>, T, Action<Exception>)

Converts a into an IObservableValue<T> which stores the current value(as Current). The subscription can be canceled through the Dispose method. Takes an initial value as second optional argument.

Declaration
public static RxObserver<T> FromObservable<T>(this ISharedState sharedState, IObservable<T> observable, T initialValue = null, Action<Exception> exceptionHandler = null)
Parameters
Type Name Description
ISharedState sharedState

The shared state to use.

Cortex.Net.IObservable<T> observable

The observable to "convert".

T initialValue

The initial value for the IObservableValue<T>.

Action<Exception> exceptionHandler

The exception handler to use.

Returns
Type Description
RxObserver<T>

An observable value.

Type Parameters
Name Description
T

The type to observe.

  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX