mirror of
https://github.com/nodejs/node.git
synced 2026-10-28 18:25:13 +08:00
doc: fix typos in async_context.md
PR-URL: https://github.com/nodejs/node/pull/47155 Reviewed-By: Debadree Chatterjee <debadree333@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Deokjin Kim <deokjin81.kim@gmail.com> Reviewed-By: Harshitha K P <harshitha014@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
This commit is contained in:
1 parent
252a069007
commit
965ea9d586
1 file changed
+1
-1
@@ -167,7 +167,7 @@ calls the function passed to it within the captured context.
|
||||
|
||||
```js
|
||||
const asyncLocalStorage = new AsyncLocalStorage();
|
||||
const runInAsyncScope = asyncLocalStorage.run(123, () => asyncLocalStorage.snapshot());
|
||||
const runInAsyncScope = asyncLocalStorage.run(123, () => AsyncLocalStorage.snapshot());
|
||||
const result = asyncLocalStorage.run(321, () => runInAsyncScope(() => asyncLocalStorage.getStore()));
|
||||
console.log(result); // returns 123
|
||||
```
|
||||
|
||||
Reference in new issue
Block a user