Apply suggestion from code review

pull/2613/head
Tony 3 months ago
parent 1610a3eca9
commit 0aa380c34a
No known key found for this signature in database
GPG Key ID: 34BDD3EA27824956

File diff suppressed because one or more lines are too long

@ -1251,15 +1251,7 @@ type WatchEventKindRemove =
*/ */
type UnwatchFn = () => void type UnwatchFn = () => void
class Watcher extends Resource { class Watcher extends Resource {}
constructor(rid: number) {
super(rid)
}
unwatch = () => {
void this.close()
}
}
async function watchInternal( async function watchInternal(
paths: string | string[] | URL | URL[], paths: string | string[] | URL | URL[],
@ -1285,7 +1277,9 @@ async function watchInternal(
const watcher = new Watcher(rid) const watcher = new Watcher(rid)
return watcher.unwatch return () => {
void watcher.close()
}
} }
// TODO: Return `Watcher` instead in v3 // TODO: Return `Watcher` instead in v3

Loading…
Cancel
Save