Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2021-01-02 16:48:05 +0300
committerRich Trott <rtrott@gmail.com>2021-01-07 09:54:02 +0300
commit67c8e2b32fe05c83a61c68bdf4a3fe45f2a5c06c (patch)
tree587c2a2b2c65d9ed55f074cff6d7a1a2c9c1f6f9 /doc/api/async_hooks.md
parent1e35d5802a265d738f6fb45b7df1f6141dd6d676 (diff)
doc: revise method text in async_hooks.md
Fix two typographical errors ("This methods") and general minor edits around the use of the word "method" in async_hooks.md. PR-URL: https://github.com/nodejs/node/pull/36736 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Harshitha K P <harshitha014@gmail.com>
Diffstat (limited to 'doc/api/async_hooks.md')
-rw-r--r--doc/api/async_hooks.md22
1 files changed, 11 insertions, 11 deletions
diff --git a/doc/api/async_hooks.md b/doc/api/async_hooks.md
index acc5d671711..a353ef3b7b9 100644
--- a/doc/api/async_hooks.md
+++ b/doc/api/async_hooks.md
@@ -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
@@ -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.
@@ -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()`
@@ -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
@@ -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.
@@ -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
@@ -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.
@@ -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`.