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

Function watch

packages/platform/deno/src/DenoFileSystem.ts:484–497  ·  view source on GitHub ↗
(
  backend: Option.Option<FileSystem.WatchBackend["Service"]>,
  path: string,
  options?: FileSystem.WatchOptions
)

Source from the content-addressed store, hash-verified

482 )
483
484const watch = (
485 backend: Option.Option<FileSystem.WatchBackend["Service"]>,
486 path: string,
487 options?: FileSystem.WatchOptions
488) =>
489 Effect.all([stat(path), Effect.serviceOption(FileSystem.WatchBackend)]).pipe(
490 Effect.map(([info, callerBackend]) =>
491 Option.orElse(callerBackend, () => backend).pipe(
492 Option.flatMap((backend) => backend.register(path, info, options)),
493 Option.getOrElse(() => watchNative(path, options))
494 )
495 ),
496 Stream.unwrap
497 )
498
499const writeFile: FileSystem.FileSystem["writeFile"] = (path, data, options) => {
500 const flag = options?.flag ?? "w"

Callers

nothing calls this directly

Calls 6

watchNativeFunction · 0.85
statFunction · 0.70
pipeMethod · 0.65
allMethod · 0.65
mapMethod · 0.45
registerMethod · 0.45

Tested by

no test coverage detected