Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: revise method text in async_hooks.md #36736

Merged
merged 1 commit into from
Jan 7, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions doc/api/async_hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -1010,7 +1010,7 @@ added:
-->

Creates a new instance of `AsyncLocalStorage`. Store is only provided within a
`run` or after `enterWith` method call.
`run()` call or after an `enterWith()` call.

### `asyncLocalStorage.disable()`
<!-- YAML
Expand All @@ -1019,7 +1019,7 @@ added:
- v12.17.0
-->

This method disables the instance of `AsyncLocalStorage`. All subsequent calls
Disables the instance of `AsyncLocalStorage`. All subsequent calls
to `asyncLocalStorage.getStore()` will return `undefined` until
`asyncLocalStorage.run()` or `asyncLocalStorage.enterWith()` is called again.

Expand All @@ -1031,7 +1031,7 @@ Calling `asyncLocalStorage.disable()` is required before the
provided by the `asyncLocalStorage`, as those objects are garbage collected
along with the corresponding async resources.

This method is to be used when the `asyncLocalStorage` is not in use anymore
Use this method when the `asyncLocalStorage` is not in use anymore
in the current process.

### `asyncLocalStorage.getStore()`
Expand All @@ -1043,10 +1043,10 @@ added:

* Returns: {any}

This method returns the current store.
If this method is called outside of an asynchronous context initialized by
calling `asyncLocalStorage.run()` or `asyncLocalStorage.enterWith()`, it will
return `undefined`.
Returns the current store.
If called outside of an asynchronous context initialized by
calling `asyncLocalStorage.run()` or `asyncLocalStorage.enterWith()`, it
returns `undefined`.

### `asyncLocalStorage.enterWith(store)`
<!-- YAML
Expand All @@ -1057,7 +1057,7 @@ added:

* `store` {any}

This method transitions into the context for the remainder of the current
Transitions into the context for the remainder of the current
synchronous execution and then persists the store through any following
asynchronous calls.

Expand All @@ -1077,7 +1077,7 @@ This transition will continue for the _entire_ synchronous execution.
This means that if, for example, the context is entered within an event
handler subsequent event handlers will also run within that context unless
specifically bound to another context with an `AsyncResource`. That is why
`run` should be preferred over `enterWith` unless there are strong reasons
`run()` should be preferred over `enterWith()` unless there are strong reasons
to use the latter method.

```js
Expand Down Expand Up @@ -1106,7 +1106,7 @@ added:
* `callback` {Function}
* `...args` {any}

This methods runs a function synchronously within a context and return its
Runs a function synchronously within a context and returns its
return value. The store is not accessible outside of the callback function or
the asynchronous operations created within the callback.

Expand Down Expand Up @@ -1140,7 +1140,7 @@ added:
* `callback` {Function}
* `...args` {any}

This methods runs a function synchronously outside of a context and return its
Runs a function synchronously outside of a context and returns its
return value. The store is not accessible within the callback function or
the asynchronous operations created within the callback. Any `getStore()`
call done within the callback function will always return `undefined`.
Expand Down