Skip to content

Commit 95b8623

Browse files
committed
Update docs for Explicit shared state.
1 parent 27db3df commit 95b8623

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Sources/ComposableArchitecture/Documentation.docc/Articles/SharingState.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ dependency or using the shared state tools discussed in this article.
7474
## Explicit shared state
7575

7676
This is the simplest kind of shared state to get started with. It allows you to share state amongst
77-
many features without any persistence. The data is only held in memory, and will be cleared out the
78-
next time the application is run.
77+
many features without any persistence. The data is only held in memory, and will be cleared out
78+
when the shared state is deallocated.
7979

8080
To share data in this style, use the `@Shared` property wrapper with no arguments.
8181
For example, suppose you have a feature that holds a count and you want to be able to hand a shared
@@ -87,7 +87,7 @@ the feature's state:
8787
struct ParentFeature {
8888
@ObservableState
8989
struct State {
90-
@Shared var count: Int
90+
@Shared(value: 0) var count: Int
9191
// Other properties
9292
}
9393
// ...

0 commit comments

Comments
 (0)