Skip to content

Commit

Permalink
doc: format v8.md in preparation for stricter linting
Browse files Browse the repository at this point in the history
PR-URL: #40647
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
  • Loading branch information
Trott authored and danielleadams committed Jan 29, 2022
1 parent e29bd46 commit 9e68c00
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion doc/api/v8.md
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,7 @@ stopHookSet();
```

### `promiseHooks.onInit(init)`

<!-- YAML
added: REPLACEME
-->
Expand All @@ -648,6 +649,7 @@ const stop = promiseHooks.onInit((promise, parent) => {});
```

### `promiseHooks.onSettled(settled)`

<!-- YAML
added: REPLACEME
-->
Expand All @@ -672,6 +674,7 @@ const stop = promiseHooks.onSettled((promise) => {});
```

### `promiseHooks.onBefore(before)`

<!-- YAML
added: REPLACEME
-->
Expand All @@ -696,6 +699,7 @@ const stop = promiseHooks.onBefore((promise) => {});
```

### `promiseHooks.onAfter(after)`

<!-- YAML
added: REPLACEME
-->
Expand All @@ -720,6 +724,7 @@ const stop = promiseHooks.onAfter((promise) => {});
```

### `promiseHooks.createHook(callbacks)`

<!-- YAML
added: REPLACEME
-->
Expand Down Expand Up @@ -776,7 +781,7 @@ not necessarily ever even be garbage collected.

Because promises are asynchronous resources whose lifecycle is tracked
via the promise hooks mechanism, the `init()`, `before()`, `after()`, and
`settled()` callbacks *must not* be async functions as they create more
`settled()` callbacks _must not_ be async functions as they create more
promises which would produce an infinite loop.

While this API is used to feed promise events into [`async_hooks`][], the
Expand Down

0 comments on commit 9e68c00

Please sign in to comment.