You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1214,7 +1214,7 @@ See the [Override Atoms](#override-atoms) and [Debugging](#debugging) sections f
1214
1214
AtomScope {
1215
1215
CounterView()
1216
1216
}
1217
-
.observe { snapshot in
1217
+
.scopedObserve { snapshot in
1218
1218
iflet count = snapshot.lookup(CounterAtom()) {
1219
1219
print(count)
1220
1220
}
@@ -1443,8 +1443,8 @@ var debugButton: some View {
1443
1443
}
1444
1444
```
1445
1445
1446
-
Or, you can observe all updates of atoms and always continue to receive `Snapshots` at that point in time through`observe(_:)` modifier of [AtomRoot](#atomroot) or [AtomScope](#atomscope).
1447
-
Note that observing in `AtomRoot` will receive all atom updates that happened in the whole app, but observing in `AtomScope` will only receive atoms used in the descendant views.
1446
+
Or, you can observe all state changes and always continue to receive `Snapshots` at that point in time with`observe(_:)` modifier of [AtomRoot](#atomroot) or with `scopedObserve(_:)` modifier of[AtomScope](#atomscope).
1447
+
Note that observing in `AtomRoot` will receive every state changes that happened in the whole app, but observing in `AtomScope` will observe changes of atoms used in the scope.
0 commit comments