diff options
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. |