From 0d58c6771d5b1513e062a5d736135b91ebcbef3b Mon Sep 17 00:00:00 2001 From: Charles Lowell Date: Tue, 24 Sep 2024 08:14:41 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20fix=20variable=20examples=20in?= =?UTF-8?q?=20async=20rosetta=20stone?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- www/docs/async-rosetta-stone.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/www/docs/async-rosetta-stone.mdx b/www/docs/async-rosetta-stone.mdx index 4f4eac4f..2e4ad931 100644 --- a/www/docs/async-rosetta-stone.mdx +++ b/www/docs/async-rosetta-stone.mdx @@ -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]