Show / Hide Table of Contents

Interface ISharedState

Interface that defines the Shared state that all nodes of the Dependency Graph share.

Namespace: Cortex.Net
Assembly: Cortex.Net.dll
Syntax
public interface ISharedState

Properties

| Improve this Doc View Source

AllowStateChanges

Gets a value indicating whether it is allowed to change observables at this point.

Declaration
bool AllowStateChanges { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

AllowStateReads

Gets a value indicating whether it is allowed to read observables at this point.

Declaration
bool AllowStateReads { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

ComputationDepth

Gets or sets the computation depth.

Declaration
int ComputationDepth { get; set; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

Configuration

Gets the Configuration for the Shared State.

Declaration
CortexConfiguration Configuration { get; }
Property Value
Type Description
CortexConfiguration
| Improve this Doc View Source

CurrentActionId

Gets or sets the Id of the Current Action.

Declaration
int CurrentActionId { get; set; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

Enhancers

Gets a list of enhancers.

Declaration
IList<IEnhancer> Enhancers { get; }
Property Value
Type Description
IList<IEnhancer>
| Improve this Doc View Source

InBatch

Gets a value indicating whether the Dependency Graph is in Batch mode.

Declaration
bool InBatch { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

NextActionId

Gets or sets the Id of the Next Action.

Declaration
int NextActionId { get; set; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

PendingReactions

Gets a queue of pending reactions.

Declaration
Queue<Reaction> PendingReactions { get; }
Property Value
Type Description
Queue<Reaction>
| Improve this Doc View Source

PendingUnobservations

Gets a queue of all pending Unobservations.

Declaration
Queue<IObservable> PendingUnobservations { get; }
Property Value
Type Description
Queue<IObservable>
| Improve this Doc View Source

RunId

Gets the shared derivation RunId counter.

Declaration
int RunId { get; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

ShouldInvoke

Gets a value indicating whether the action should be invoked on the original thread that created the context.

Declaration
bool ShouldInvoke { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

SuppressReactionErrors

Gets or sets a value indicating whether to suppress reaction errors. Suppressing happens when an action is the root cause of reactions to fail further because of the incorrect state.

Declaration
bool SuppressReactionErrors { get; set; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

TrackingDerivation

Gets the IDerivation instance that the shared state is currently tracking.

Declaration
IDerivation TrackingDerivation { get; }
Property Value
Type Description
IDerivation

Methods

| Improve this Doc View Source

EndAllowStateChanges(Boolean)

End of a section where AllowStateChanges is modified.

Declaration
void EndAllowStateChanges(bool previousAllowStateChanges)
Parameters
Type Name Description
System.Boolean previousAllowStateChanges

The previous value to restore.

| Improve this Doc View Source

EndAllowStateReads(Boolean)

End of a section where AllowStateReads is modified.

Declaration
void EndAllowStateReads(bool previousAllowStateReads)
Parameters
Type Name Description
System.Boolean previousAllowStateReads

The previous value to restore.

| Improve this Doc View Source

EndBatch()

Ends a Batch.

Declaration
void EndBatch()
Remarks

This method can be called multiple times but should always be balanced with an equal amount of StartBatch() calls.

| Improve this Doc View Source

EndTracking(IDerivation)

Ends tracking the current IDerivation instance and restores the previous derivation.

Declaration
void EndTracking(IDerivation previousDerivation)
Parameters
Type Name Description
IDerivation previousDerivation

The previous derivation.

| Improve this Doc View Source

GetUniqueId()

Gets a unique Id that is incremented every time.

Declaration
int GetUniqueId()
Returns
Type Description
System.Int32

The new unique Id.

| Improve this Doc View Source

IncrementRunId()

Increments the RunId and returns the new value.

Declaration
int IncrementRunId()
Returns
Type Description
System.Int32

The new RunId.

| Improve this Doc View Source

OnSpy(Object, SpyEventArgs)

Triggers the Spy event handler with the specified event args.

Declaration
void OnSpy(object sender, SpyEventArgs spyEventArgs)
Parameters
Type Name Description
System.Object sender

The sender of the event.

SpyEventArgs spyEventArgs

The event arguments for the spy event.

| Improve this Doc View Source

OnUnhandledReactionException(Reaction, UnhandledExceptionEventArgs)

Fires the UnhandledReactionException event.

Declaration
void OnUnhandledReactionException(Reaction reaction, UnhandledExceptionEventArgs unhandledExceptionEventArgs)
Parameters
Type Name Description
Reaction reaction

The reaction that caused the unhandled exception.

UnhandledExceptionEventArgs unhandledExceptionEventArgs

The event arguments for the exception.

| Improve this Doc View Source

RunReactions()

Runs reactions.

Declaration
void RunReactions()
| Improve this Doc View Source

StartAllowStateChanges(Boolean)

Start of a section where AllowStateChanges is modified.

Declaration
bool StartAllowStateChanges(bool allowStateChanges)
Parameters
Type Name Description
System.Boolean allowStateChanges

Whether to allow State changes.

Returns
Type Description
System.Boolean

The previous value.

| Improve this Doc View Source

StartAllowStateReads(Boolean)

Start of a section where AllowStateReads is modified.

Declaration
bool StartAllowStateReads(bool allowStateReads)
Parameters
Type Name Description
System.Boolean allowStateReads

Whether to allow State reads.

Returns
Type Description
System.Boolean

The previous value.

| Improve this Doc View Source

StartBatch()

Starts a Batch.

Declaration
void StartBatch()
Remarks

This method can be called multiple times but should always be balanced with an equal amount of EndBatch() calls.

| Improve this Doc View Source

StartTracking(IDerivation)

Starts tracking the IDerivation instance given as paramteter.

Declaration
IDerivation StartTracking(IDerivation derivation)
Parameters
Type Name Description
IDerivation derivation

The derivation to track.

Returns
Type Description
IDerivation

The prevous derivation.

| Improve this Doc View Source

StartUntracked()

Starts an untracked part of a derviation.

Declaration
IDerivation StartUntracked()
Returns
Type Description
IDerivation

The current derivation to restore later.

Events

| Improve this Doc View Source

SpyEvent

Spy event that fires when any observable attached to this Shared State reports a significant change. Can be used to implement a state inspection tool or something like react-dev-tools.

Declaration
event EventHandler<SpyEventArgs> SpyEvent
Event Type
Type Description
EventHandler<SpyEventArgs>
| Improve this Doc View Source

UnhandledReactionException

Event that fires when a reaction produces an unhandled exception.

Declaration
event EventHandler<UnhandledExceptionEventArgs> UnhandledReactionException
Event Type
Type Description
EventHandler<UnhandledExceptionEventArgs>

Extension Methods

ActionExtensions.RunInAction(ISharedState, Action)
ActionExtensions.RunInAction(ISharedState, String, Action)
ActionExtensions.RunInAction(ISharedState, String, Object, Action)
ActionExtensions.CreateAction(ISharedState, Action)
ActionExtensions.CreateAction(ISharedState, String, Action)
ActionExtensions.CreateAction(ISharedState, String, Object, Action)
ActionExtensions.CreateAction<T1>(ISharedState, Action<T1>)
ActionExtensions.CreateAction<T1>(ISharedState, String, Action<T1>)
ActionExtensions.CreateAction<T1>(ISharedState, String, Object, Action<T1>)
ActionExtensions.CreateAction<T1, T2>(ISharedState, Action<T1, T2>)
ActionExtensions.CreateAction<T1, T2>(ISharedState, String, Action<T1, T2>)
ActionExtensions.CreateAction<T1, T2>(ISharedState, String, Object, Action<T1, T2>)
ActionExtensions.CreateAction<T1, T2, T3>(ISharedState, Action<T1, T2, T3>)
ActionExtensions.CreateAction<T1, T2, T3>(ISharedState, String, Action<T1, T2, T3>)
ActionExtensions.CreateAction<T1, T2, T3>(ISharedState, String, Object, Action<T1, T2, T3>)
ActionExtensions.CreateAction<T1, T2, T3, T4>(ISharedState, Action<T1, T2, T3, T4>)
ActionExtensions.CreateAction<T1, T2, T3, T4>(ISharedState, String, Action<T1, T2, T3, T4>)
ActionExtensions.CreateAction<T1, T2, T3, T4>(ISharedState, String, Object, Action<T1, T2, T3, T4>)
ActionExtensions.CreateAction<T1, T2, T3, T4, T5>(ISharedState, Action<T1, T2, T3, T4, T5>)
ActionExtensions.CreateAction<T1, T2, T3, T4, T5>(ISharedState, String, Action<T1, T2, T3, T4, T5>)
ActionExtensions.CreateAction<T1, T2, T3, T4, T5>(ISharedState, String, Object, Action<T1, T2, T3, T4, T5>)
ActionExtensions.CreateAction<T1, T2, T3, T4, T5, T6>(ISharedState, Action<T1, T2, T3, T4, T5, T6>)
ActionExtensions.CreateAction<T1, T2, T3, T4, T5, T6>(ISharedState, String, Action<T1, T2, T3, T4, T5, T6>)
ActionExtensions.CreateAction<T1, T2, T3, T4, T5, T6>(ISharedState, String, Object, Action<T1, T2, T3, T4, T5, T6>)
ActionExtensions.CreateAction<T1, T2, T3, T4, T5, T6, T7>(ISharedState, Action<T1, T2, T3, T4, T5, T6, T7>)
ActionExtensions.CreateAction<T1, T2, T3, T4, T5, T6, T7>(ISharedState, String, Action<T1, T2, T3, T4, T5, T6, T7>)
ActionExtensions.CreateAction<T1, T2, T3, T4, T5, T6, T7>(ISharedState, String, Object, Action<T1, T2, T3, T4, T5, T6, T7>)
ActionExtensions.CreateAction<T1, T2, T3, T4, T5, T6, T7, T8>(ISharedState, Action<T1, T2, T3, T4, T5, T6, T7, T8>)
ActionExtensions.CreateAction<T1, T2, T3, T4, T5, T6, T7, T8>(ISharedState, String, Action<T1, T2, T3, T4, T5, T6, T7, T8>)
ActionExtensions.CreateAction<T1, T2, T3, T4, T5, T6, T7, T8>(ISharedState, String, Object, Action<T1, T2, T3, T4, T5, T6, T7, T8>)
ActionExtensions.CreateAction<T1, T2, T3, T4, T5, T6, T7, T8, T9>(ISharedState, Action<T1, T2, T3, T4, T5, T6, T7, T8, T9>)
ActionExtensions.CreateAction<T1, T2, T3, T4, T5, T6, T7, T8, T9>(ISharedState, String, Action<T1, T2, T3, T4, T5, T6, T7, T8, T9>)
ActionExtensions.CreateAction<T1, T2, T3, T4, T5, T6, T7, T8, T9>(ISharedState, String, Object, Action<T1, T2, T3, T4, T5, T6, T7, T8, T9>)
ActionExtensions.CreateAction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(ISharedState, Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>)
ActionExtensions.CreateAction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(ISharedState, String, Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>)
ActionExtensions.CreateAction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(ISharedState, String, Object, Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>)
ActionExtensions.CreateAction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(ISharedState, Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>)
ActionExtensions.CreateAction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(ISharedState, String, Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>)
ActionExtensions.CreateAction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(ISharedState, String, Object, Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>)
ActionExtensions.CreateAction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(ISharedState, Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>)
ActionExtensions.CreateAction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(ISharedState, String, Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>)
ActionExtensions.CreateAction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(ISharedState, String, Object, Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>)
ActionExtensions.CreateAction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(ISharedState, Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>)
ActionExtensions.CreateAction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(ISharedState, String, Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>)
ActionExtensions.CreateAction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(ISharedState, String, Object, Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>)
ActionExtensions.CreateAction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(ISharedState, Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>)
ActionExtensions.CreateAction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(ISharedState, String, Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>)
ActionExtensions.CreateAction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(ISharedState, String, Object, Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>)
ActionExtensions.CreateAction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(ISharedState, Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>)
ActionExtensions.CreateAction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(ISharedState, String, Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>)
ActionExtensions.CreateAction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(ISharedState, String, Object, Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>)
ActionExtensions.CreateAction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(ISharedState, Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>)
ActionExtensions.CreateAction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(ISharedState, String, Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>)
ActionExtensions.CreateAction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(ISharedState, String, Object, Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>)
SharedStateObservableExtensions.Observable<T>(ISharedState, Func<T>)
SharedStateObservableExtensions.Box<T>(ISharedState, T, String, IEnhancer)
SharedStateObservableExtensions.Collection<T>(ISharedState, IEnumerable<T>, String, IEnhancer)
SharedStateObservableExtensions.Set<T>(ISharedState, IEnumerable<T>, String, IEnhancer)
SharedStateObservableExtensions.Dictionary<TKey, TValue>(ISharedState, IDictionary<TKey, TValue>, String, IEnhancer)
SharedStateObservableExtensions.Computed<T>(ISharedState, Func<T>, String)
SharedStateReactionExtensions.Autorun(ISharedState, Action<Reaction>, AutorunOptions)
SharedStateReactionExtensions.Reaction<T>(ISharedState, Func<Reaction, T>, Action<T, Reaction>, ReactionOptions<T>)
SharedStateReactionExtensions.Reaction<T>(ISharedState, Func<Reaction, T>, Func<T, Reaction, Task>, ReactionOptions<T>)
SharedStateTransactionExtensions.Transaction(ISharedState, Action)
SharedStateWhenExtensions.When(ISharedState, Func<Boolean>, Action, WhenOptions)
SharedStateWhenExtensions.When(ISharedState, Func<Boolean>, WhenOptions)
SharedStateWhenExtensions.When(ISharedState, Func<Boolean>, CancellationToken, WhenOptions)
TraceExtensions.Trace(ISharedState, TraceMode)
TraceExtensions.Trace<TObject, TMember>(TObject, Expression<Func<TObject, TMember>>, TraceMode)
ActionExtensions.Untracked<T>(ISharedState, Func<T>)
ActionExtensions.Untracked(ISharedState, Action)
ActionExtensions.GetEnhancer(ISharedState, Type)
ActionExtensions.ReferenceEnhancer(ISharedState)
ActionExtensions.DeepEnhancer(ISharedState)
ActionExtensions.AllowStateChanges<T>(ISharedState, Boolean, Func<T>)
ActionExtensions.AllowStateChangesInsideComputed<T>(ISharedState, Func<T>)
SharedStateReactiveExtensions.AsObservable<T>(ISharedState, Func<T>, Boolean)
SharedStateReactiveExtensions.FromObservable<T>(ISharedState, IObservable<T>, T, Action<Exception>)
ReactiveObjectTypeUtilExtensions.GetObservable(Object)
ReactiveObjectTypeUtilExtensions.GetObservable<TObject, TMember>(TObject, Expression<Func<TObject, TMember>>)
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX