import { debounce } from "https://dotland.deno.dev/std@0.116.0/async/mod.ts";
Creates a debounced function that delays the given func
by a given wait
time in milliseconds. If the method is called
again before the timeout expires, the previous call will be
aborted.
import { debounce } from "./debounce.ts";
const log = debounce(
(event: Deno.FsEvent) =>
console.log("[%s] %s", event.kind, event.paths[0]),
200,
);
for await (const event of Deno.watchFs("./")) {
log(event);
}