Skip to content

Commit 1987746

Browse files
Update README.md
1 parent 1a5411f commit 1987746

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# SharedObject 🍱
22

3-
`@SharedObject` is an alternative way to `@StateObject`, `@ObservedObject`, `@EnvironmentObject` for handle `ObservableObject`.
3+
`@SharedObject` is an alternative to `@StateObject`, `@ObservedObject`, `@EnvironmentObject` to handle `ObservableObject`.
44
If you need to have multiple objects of the same class persisted among multiple view instances, its difficult to handle the situation with other wrappers: with `@StateObject` the object will deinit with the view and be generated only for the specific view instance, with `@EnvironmentObject` you can bind only one instance of the same class for each Environment and with `@ObservedObject` is difficult to propagate object in nested views.
55

66
`@SharedObject` simply stores the objects using an identifier, so you can retrieve it each time you'll need it.

0 commit comments

Comments
 (0)