MCPcopy Create free account
hub / github.com/Effect-TS/effect / Watcher

Class Watcher

packages/effect/test/ui/kit/DialogDocument.test.ts:509–526  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

507 { destroyed: boolean; request: (cancelable: boolean) => boolean }
508 > = []
509 class Watcher extends EventTarget {
510 destroyed = false
511 constructor() {
512 super()
513 made.push(this)
514 }
515 destroy() {
516 this.destroyed = true
517 }
518 request(cancelable: boolean) {
519 const cancel = new Event("cancel", { cancelable })
520 this.dispatchEvent(cancel)
521 if (cancel.defaultPrevented) return true
522 this.destroyed = true
523 this.dispatchEvent(new Event("close"))
524 return false
525 }
526 }
527 const userAgent = platform.android
528 ? "Mozilla/5.0 (Linux; Android 14) Chrome/130.0"
529 : navigator.userAgent

Callers 2

swapFunction · 0.50

Calls

no outgoing calls

Tested by 1

swapFunction · 0.40