Skip to content

Commit fd40512

Browse files
committed
[docs] Fix async examples in whats-new.md
1 parent ea8f97c commit fd40512

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

website/docs/whats-new.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ Here's a single expression to a query builder, which can be expected to return
9393
a single result:
9494

9595
```typescript
96-
const earth = source.query((q) =>
96+
const earth = await source.query((q) =>
9797
q.findRecord({ type: 'planet', id: 'earth' })
9898
);
9999
```
@@ -102,15 +102,15 @@ That same expression could be passed in an array, which will cause results to be
102102
returned in an array:
103103

104104
```typescript
105-
const [earth] = source.query((q) => [
105+
const [earth] = await source.query((q) => [
106106
q.findRecord({ type: 'planet', id: 'earth' })
107107
]);
108108
```
109109

110110
And of course, that array could be expanded to include more than one expression:
111111

112112
```typescript
113-
const [earth, jupiter, saturn] = source.query((q) => [
113+
const [earth, jupiter, saturn] = await source.query((q) => [
114114
q.findRecord({ type: 'planet', id: 'earth' }),
115115
q.findRecord({ type: 'planet', id: 'jupiter' }),
116116
q.findRecord({ type: 'planet', id: 'saturn' })
@@ -134,7 +134,7 @@ All the patterns mentioned above for queries also apply to transforms.
134134
A single operation provided to a transform builder will return a single result:
135135

136136
```typescript
137-
const earth = source.update((t) =>
137+
const earth = await source.update((t) =>
138138
t.addRecord({ type: 'planet', id: 'earth' })
139139
);
140140
```
@@ -143,15 +143,15 @@ The same expression passed in an array will cause results to be returned in an
143143
array:
144144

145145
```typescript
146-
const [earth] = source.update((t) => [
146+
const [earth] = await source.update((t) => [
147147
t.addRecord({ type: 'planet', id: 'earth' })
148148
]);
149149
```
150150

151151
And as before, multi-operation transforms will produce an array of results:
152152

153153
```typescript
154-
const [earth, jupiter, saturn] = source.update((t) => [
154+
const [earth, jupiter, saturn] = await source.update((t) => [
155155
t.addRecord({ type: 'planet', id: 'earth' }),
156156
t.addRecord({ type: 'planet', id: 'jupiter' }),
157157
t.addRecord({ type: 'planet', id: 'saturn' })

0 commit comments

Comments
 (0)