Skip to content

Commit

Permalink
doc,timers: use code markup/markdown in headers
Browse files Browse the repository at this point in the history
PR-URL: #31086
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
  • Loading branch information
Trott authored and BridgeAR committed Jan 3, 2020
1 parent cf563bb commit 450d9a2
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions doc/api/timers.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The timer functions within Node.js implement a similar API as the timers API
provided by Web Browsers but use a different internal implementation that is
built around the Node.js [Event Loop][].

## Class: Immediate
## Class: `Immediate`

This object is created internally and is returned from [`setImmediate()`][]. It
can be passed to [`clearImmediate()`][] in order to cancel the scheduled
Expand All @@ -23,7 +23,7 @@ running as long as the immediate is active. The `Immediate` object returned by
[`setImmediate()`][] exports both `immediate.ref()` and `immediate.unref()`
functions that can be used to control this default behavior.

### immediate.hasRef()
### `immediate.hasRef()`
<!-- YAML
added: v11.0.0
-->
Expand All @@ -32,7 +32,7 @@ added: v11.0.0

If true, the `Immediate` object will keep the Node.js event loop active.

### immediate.ref()
### `immediate.ref()`
<!-- YAML
added: v9.7.0
-->
Expand All @@ -46,7 +46,7 @@ effect.
By default, all `Immediate` objects are "ref'ed", making it normally unnecessary
to call `immediate.ref()` unless `immediate.unref()` had been called previously.

### immediate.unref()
### `immediate.unref()`
<!-- YAML
added: v9.7.0
-->
Expand All @@ -58,7 +58,7 @@ loop to remain active. If there is no other activity keeping the event loop
running, the process may exit before the `Immediate` object's callback is
invoked. Calling `immediate.unref()` multiple times will have no effect.

## Class: Timeout
## Class: `Timeout`

This object is created internally and is returned from [`setTimeout()`][] and
[`setInterval()`][]. It can be passed to either [`clearTimeout()`][] or
Expand All @@ -70,7 +70,7 @@ timer is active. Each of the `Timeout` objects returned by these functions
export both `timeout.ref()` and `timeout.unref()` functions that can be used to
control this default behavior.

### timeout.hasRef()
### `timeout.hasRef()`
<!-- YAML
added: v11.0.0
-->
Expand All @@ -79,7 +79,7 @@ added: v11.0.0

If true, the `Timeout` object will keep the Node.js event loop active.

### timeout.ref()
### `timeout.ref()`
<!-- YAML
added: v0.9.1
-->
Expand All @@ -92,7 +92,7 @@ When called, requests that the Node.js event loop *not* exit so long as the
By default, all `Timeout` objects are "ref'ed", making it normally unnecessary
to call `timeout.ref()` unless `timeout.unref()` had been called previously.

### timeout.refresh()
### `timeout.refresh()`
<!-- YAML
added: v10.2.0
-->
Expand All @@ -107,7 +107,7 @@ JavaScript object.
Using this on a timer that has already called its callback will reactivate the
timer.

### timeout.unref()
### `timeout.unref()`
<!-- YAML
added: v0.9.1
-->
Expand All @@ -130,7 +130,7 @@ a certain period of time. When a timer's function is called varies depending on
which method was used to create the timer and what other work the Node.js
event loop is doing.

### setImmediate(callback\[, ...args\])
### `setImmediate(callback[, ...args])`
<!-- YAML
added: v0.9.1
-->
Expand Down Expand Up @@ -172,7 +172,7 @@ async function timerExample() {
timerExample();
```

### setInterval(callback, delay\[, ...args\])
### `setInterval(callback, delay[, ...args])`
<!-- YAML
added: v0.0.1
-->
Expand All @@ -190,7 +190,7 @@ set to `1`. Non-integer delays are truncated to an integer.

If `callback` is not a function, a [`TypeError`][] will be thrown.

### setTimeout(callback, delay\[, ...args\])
### `setTimeout(callback, delay[, ...args])`
<!-- YAML
added: v0.0.1
-->
Expand Down Expand Up @@ -235,7 +235,7 @@ cancel the timer and prevent it from triggering.
It is not possible to cancel timers that were created using the promisified
variants of [`setImmediate()`][], [`setTimeout()`][].

### clearImmediate(immediate)
### `clearImmediate(immediate)`
<!-- YAML
added: v0.9.1
-->
Expand All @@ -245,7 +245,7 @@ added: v0.9.1

Cancels an `Immediate` object created by [`setImmediate()`][].

### clearInterval(timeout)
### `clearInterval(timeout)`
<!-- YAML
added: v0.0.1
-->
Expand All @@ -254,7 +254,7 @@ added: v0.0.1

Cancels a `Timeout` object created by [`setInterval()`][].

### clearTimeout(timeout)
### `clearTimeout(timeout)`
<!-- YAML
added: v0.0.1
-->
Expand Down

0 comments on commit 450d9a2

Please sign in to comment.