Skip to content

Commit

Permalink
Merge pull request #37 from pharry22/patch-7
Browse files Browse the repository at this point in the history
Update sharedstate.md
  • Loading branch information
jspuij authored Jul 15, 2020
2 parents 7f866cc + 9477db4 commit 1b02a90
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/pages/sharedstate.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ create your observables with [Observable<T>](xref:Cortex.Net.Api.SharedSta
To use constructor arguments in your models to pass around [ISharedState](xref:Cortex.Net.ISharedState) instances,
you can implement [IReactiveObject](xref:Cortex.Net.IReactiveObject) yourself. Do it exactly like this with an
auto-generated public getter and private setter. The weaver will then append the setter with the correct code to
handle Shared State assignment. You must must assign `this.SharedState` in the constructor or you will get
handle Shared State assignment. You must assign `this.SharedState` in the constructor or you will get
NullReferenceExceptions.

```csharp
Expand All @@ -173,4 +173,4 @@ public class PersonWeave : IReactiveObject
Generally explicit constructor arguments are nice for DI, and make your dependencies clear, but it
may give problems with serialization libraries or ui components that require parameterless constructors.
It also saves you a call to [Observable<T>](xref:Cortex.Net.Api.SharedStateObservableExtensions.Observable*)
to implicitly pass the shared state around. Choose wisely.
to implicitly pass the shared state around. Choose wisely.

0 comments on commit 1b02a90

Please sign in to comment.