Skip to content

Commit 5e45bc7

Browse files
authored
Add syntax highlighting and fix typo. (#2008)
1 parent f17ac76 commit 5e45bc7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

proposals/0395-observability.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,13 +203,13 @@ extension Observable {
203203

204204
All `Observable` types must correctly handle their own exclusivity, thread safety, and/or isolation. For example, if two properties must change together, with no observation of a halfway state where one has changed and the other hasn't, then it is the type's responsibility to provide that atomicity. For example, for an observable type named `ImageDescription`, with `width` and `height` properties that must be updated in lockstep, the type must assign both properties without an interrupting suspension point:
205205

206-
```
206+
```swift
207207
@Observable class ImageDescription {
208208
// ...
209209

210210
func BAD_updateDimensions() async {
211211
self.width = await getUpdatedWidth()
212-
self.height = away getUpdatedHeight()
212+
self.height = await getUpdatedHeight()
213213
}
214214

215215
func GOOD_updateDimensions() async {

0 commit comments

Comments
 (0)