File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Sources/ComposableArchitecture/Documentation.docc/Articles Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -74,8 +74,8 @@ dependency or using the shared state tools discussed in this article.
74
74
## Explicit shared state
75
75
76
76
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 .
79
79
80
80
To share data in this style, use the ` @Shared ` property wrapper with no arguments.
81
81
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:
87
87
struct ParentFeature {
88
88
@ObservableState
89
89
struct State {
90
- @Shared var count: Int
90
+ @Shared (value : 0 ) var count: Int
91
91
// Other properties
92
92
}
93
93
// ...
You can’t perform that action at this time.
0 commit comments