Skip to content

Commit

Permalink
fix(docs): update os signals example to the latest Deno.signal API (#102
Browse files Browse the repository at this point in the history
)
  • Loading branch information
meszarosdezso authored Oct 1, 2021
1 parent 4df0b8b commit dea44b3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/os_signals.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ You can use `Deno.signal()` function for handling OS signals:
* async-iterator-signal.ts
*/
console.log("Press Ctrl-C to trigger a SIGINT signal");
for await (const _ of Deno.signal(Deno.Signal.SIGINT)) {
for await (const _ of Deno.signal("SIGINT")) {
console.log("interrupted!");
Deno.exit();
}
Expand All @@ -42,7 +42,7 @@ deno run --unstable async-iterator-signal.ts
* promise-signal.ts
*/
console.log("Press Ctrl-C to trigger a SIGINT signal");
await Deno.signal(Deno.Signal.SIGINT);
await Deno.signal("SIGINT");
console.log("interrupted!");
Deno.exit();
```
Expand All @@ -62,7 +62,7 @@ signal object:
/**
* dispose-signal.ts
*/
const sig = Deno.signal(Deno.Signal.SIGINT);
const sig = Deno.signal("SIGINT");
setTimeout(() => {
sig.dispose();
console.log("No longer watching SIGINT signal");
Expand Down

0 comments on commit dea44b3

Please sign in to comment.