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 <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Voltrex <[email protected]>
Reviewed-By: Zijian Liu <[email protected]>
Reviewed-By: Gerhard Stöbich <[email protected]>
  • Loading branch information
targos committed Nov 6, 2021
1 parent 488ee51 commit 6e3e50f
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 6e3e50f

Please sign in to comment.