diff options
author | tokiedokie <42903136+tokiedokie@users.noreply.github.com> | 2020-08-15 22:46:36 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-15 09:46:36 -0400 |
commit | 496c9d73a11d3356bf1675e5ca44c10cd3c99939 (patch) | |
tree | ca010bbd57346bd083d18d0f07d48a6772b74987 /docs/examples | |
parent | b9adfe53d386aa670ae2e40732e711d2b76877a4 (diff) |
improve docs (#7053)
Diffstat (limited to 'docs/examples')
-rw-r--r-- | docs/examples/os_signals.md | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/docs/examples/os_signals.md b/docs/examples/os_signals.md index 225d7301a..3b2411bde 100644 --- a/docs/examples/os_signals.md +++ b/docs/examples/os_signals.md @@ -5,7 +5,7 @@ [API Reference](https://doc.deno.land/https/raw.githubusercontent.com/denoland/deno/master/cli/dts/lib.deno.unstable.d.ts#Deno.signal) -You can use `Deno.signal()` function for handling OS signals. +You can use `Deno.signal()` function for handling OS signals: ```ts for await (const _ of Deno.signal(Deno.Signal.SIGINT)) { @@ -13,7 +13,7 @@ for await (const _ of Deno.signal(Deno.Signal.SIGINT)) { } ``` -`Deno.signal()` also works as a promise. +`Deno.signal()` also works as a promise: ```ts await Deno.signal(Deno.Signal.SIGINT); @@ -21,7 +21,7 @@ console.log("interrupted!"); ``` If you want to stop watching the signal, you can use `dispose()` method of the -signal object. +signal object: ```ts const sig = Deno.signal(Deno.Signal.SIGINT); @@ -34,4 +34,4 @@ for await (const _ of sig) { } ``` -The above for-await loop exits after 5 seconds when sig.dispose() is called. +The above for-await loop exits after 5 seconds when `sig.dispose()` is called. |