Skip to content

Commit

Permalink
doc: replace "you should do X" with "do X"
Browse files Browse the repository at this point in the history
PR-URL: #35194
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
  • Loading branch information
Trott authored and addaleax committed Sep 22, 2020
1 parent c606ed7 commit 3ffaf66
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions doc/api/async_hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -1162,14 +1162,14 @@ functions called by `foo`. Outside of `run`, calling `getStore` will return

In most cases your application or library code should have no issues with
`AsyncLocalStorage`. But in rare cases you may face situations when the
current store is lost in one of asynchronous operations. Then you should
current store is lost in one of asynchronous operations. In those cases,
consider the following options.

If your code is callback-based, it is enough to promisify it with
[`util.promisify()`][], so it starts working with native promises.

If you need to keep using callback-based API, or your code assumes
a custom thenable implementation, you should use [`AsyncResource`][] class
a custom thenable implementation, use the [`AsyncResource`][] class
to associate the asynchronous operation with the correct execution context.

[`AsyncResource`]: #async_hooks_class_asyncresource
Expand Down

0 comments on commit 3ffaf66

Please sign in to comment.