Skip to content

Commit 8620458

Browse files
Trotttargos
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 <gpunathi@in.ibm.com> Reviewed-By: Harshitha K P <harshitha014@gmail.com>
1 parent 682d0a9 commit 8620458

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
@@ -1000,14 +1000,14 @@ added: v13.10.0
10001000
-->
10011001

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

10051005
### `asyncLocalStorage.disable()`
10061006
<!-- YAML
10071007
added: v13.10.0
10081008
-->
10091009

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

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

1022-
This method is to be used when the `asyncLocalStorage` is not in use anymore
1022+
Use this method when the `asyncLocalStorage` is not in use anymore
10231023
in the current process.
10241024

10251025
### `asyncLocalStorage.getStore()`
@@ -1029,10 +1029,10 @@ added: v13.10.0
10291029

10301030
* Returns: {any}
10311031

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

10371037
### `asyncLocalStorage.enterWith(store)`
10381038
<!-- YAML
@@ -1041,7 +1041,7 @@ added: v13.11.0
10411041

10421042
* `store` {any}
10431043

1044-
This method transitions into the context for the remainder of the current
1044+
Transitions into the context for the remainder of the current
10451045
synchronous execution and then persists the store through any following
10461046
asynchronous calls.
10471047

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

10671067
```js
@@ -1088,7 +1088,7 @@ added: v13.10.0
10881088
* `callback` {Function}
10891089
* `...args` {any}
10901090

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

@@ -1120,7 +1120,7 @@ added: v13.10.0
11201120
* `callback` {Function}
11211121
* `...args` {any}
11221122

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

0 commit comments

Comments
 (0)