Skip to content

Commit

Permalink
doc: improve async_context introduction
Browse files Browse the repository at this point in the history
- Rename "Async_context" to "Asynchronous context tracking" in toc.
- Use named imports to show how `AsyncLocalStorage` and `AsyncResource`
  can be imported.

PR-URL: #40560
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Voltrex <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
  • Loading branch information
targos authored and BethGriggs committed Nov 24, 2021
1 parent 7590bac commit 2d4a042
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions doc/api/async_context.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Asynchronous Context Tracking
# Asynchronous context tracking

<!--introduced_in=v16.4.0-->

Expand All @@ -18,11 +18,11 @@ The `AsyncLocalStorage` and `AsyncResource` classes are part of the
`async_hooks` module:

```mjs
import async_hooks from 'async_hooks';
import { AsyncLocalStorage, AsyncResource } from 'async_hooks';
```

```cjs
const async_hooks = require('async_hooks');
const { AsyncLocalStorage, AsyncResource } = require('async_hooks');
```

## Class: `AsyncLocalStorage`
Expand Down
2 changes: 1 addition & 1 deletion doc/api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<hr class="line"/>

* [Assertion testing](assert.md)
* [Async\_context](async\_context.md)
* [Asynchronous context tracking](async\_context.md)
* [Async hooks](async\_hooks.md)
* [Buffer](buffer.md)
* [C++ addons](addons.md)
Expand Down

0 comments on commit 2d4a042

Please sign in to comment.