import { Timeout } from "https://deno.land/x/timers@v0.2.0/src/Timeout.ts";
Examples
Example 1
Example 1
const abort = new AbortController();
const { signal } = abort;
const timeout = new Timeout(
() => {
console.log("hello world");
},
100,
{ signal, }
);
timeout.run();
yourService.addEventListener("error", () => abort.abort(), { once: true })