Skip to content

Commit 757b966

Browse files
Trottdanielleadams
authored andcommitted
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: #36736 Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Harshitha K P <[email protected]>
1 parent 4601886 commit 757b966

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

doc/api/async_hooks.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -1010,7 +1010,7 @@ added:
10101010
-->
10111011

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

10151015
### `asyncLocalStorage.disable()`
10161016
<!-- YAML
@@ -1019,7 +1019,7 @@ added:
10191019
- v12.17.0
10201020
-->
10211021

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

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

1034-
This method is to be used when the `asyncLocalStorage` is not in use anymore
1034+
Use this method when the `asyncLocalStorage` is not in use anymore
10351035
in the current process.
10361036

10371037
### `asyncLocalStorage.getStore()`
@@ -1043,10 +1043,10 @@ added:
10431043

10441044
* Returns: {any}
10451045

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

10511051
### `asyncLocalStorage.enterWith(store)`
10521052
<!-- YAML
@@ -1057,7 +1057,7 @@ added:
10571057

10581058
* `store` {any}
10591059

1060-
This method transitions into the context for the remainder of the current
1060+
Transitions into the context for the remainder of the current
10611061
synchronous execution and then persists the store through any following
10621062
asynchronous calls.
10631063

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

10831083
```js
@@ -1106,7 +1106,7 @@ added:
11061106
* `callback` {Function}
11071107
* `...args` {any}
11081108

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

@@ -1140,7 +1140,7 @@ added:
11401140
* `callback` {Function}
11411141
* `...args` {any}
11421142

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

0 commit comments

Comments
 (0)