0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-03-03 09:31:22 -05:00

docs(cli/dts): fix Deno.watchFs example (#10570)

This commit is contained in:
Casper Beyer 2021-05-11 10:18:29 +08:00 committed by GitHub
parent ba8d6ec771
commit 2b8bac3c85
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1970,7 +1970,13 @@ declare namespace Deno {
*
* ```ts
* const watcher = Deno.watchFs("/");
* setTimeout(() => { watcher.return(); }, 5000);
*
* setTimeout(() => {
* if (watcher.return) {
* watcher.return();
* }
* }, 5000);
*
* for await (const event of watcher) {
* console.log(">>>> event", event);
* }