Skip to content

Commit

Permalink
πŸ“ fix variable examples in async rosetta stone
Browse files Browse the repository at this point in the history
In the section for promises and operations, we were re-assigning the
variables to the value of the evaluated promise/operation.

While syntactically acceptable, it is a bad idea and nobody would ever
write code like that.
  • Loading branch information
cowboyd committed Sep 24, 2024
1 parent ef3e740 commit 0d58c67
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions www/docs/async-rosetta-stone.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,13 @@ value has been computed.
To use a promise:

```js
let promise = await promise;
let result = await promise;
```

To use an operation:

```js
let operation = yield* operation;
let result = yield* operation;
```

To convert from a promise to an operation, use [`call()`][call]
Expand Down

0 comments on commit 0d58c67

Please sign in to comment.