Skip to content

Commit

Permalink
[docs] Fix async examples in whats-new.md
Browse files Browse the repository at this point in the history
  • Loading branch information
dgeb committed Aug 11, 2022
1 parent ea8f97c commit fd40512
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions website/docs/whats-new.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ Here's a single expression to a query builder, which can be expected to return
a single result:

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

```typescript
const [earth] = source.query((q) => [
const [earth] = await source.query((q) => [
q.findRecord({ type: 'planet', id: 'earth' })
]);
```

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

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

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

```typescript
const [earth] = source.update((t) => [
const [earth] = await source.update((t) => [
t.addRecord({ type: 'planet', id: 'earth' })
]);
```

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

```typescript
const [earth, jupiter, saturn] = source.update((t) => [
const [earth, jupiter, saturn] = await source.update((t) => [
t.addRecord({ type: 'planet', id: 'earth' }),
t.addRecord({ type: 'planet', id: 'jupiter' }),
t.addRecord({ type: 'planet', id: 'saturn' })
Expand Down

0 comments on commit fd40512

Please sign in to comment.