MCPcopy
hub / github.com/Effect-TS/effect / watch

Function watch

packages/platform-node-shared/src/internal/fileSystem.ts:581–594  ·  view source on GitHub ↗
(
  backend: Option.Option<Context.Tag.Service<FileSystem.WatchBackend>>,
  path: string,
  options?: FileSystem.WatchOptions
)

Source from the content-addressed store, hash-verified

579 )
580
581const watch = (
582 backend: Option.Option<Context.Tag.Service<FileSystem.WatchBackend>>,
583 path: string,
584 options?: FileSystem.WatchOptions
585) =>
586 stat(path).pipe(
587 Effect.map((stat) =>
588 backend.pipe(
589 Option.flatMap((_) => _.register(path, stat, options)),
590 Option.getOrElse(() => watchNode(path, options))
591 )
592 ),
593 Stream.unwrap
594 )
595
596// == writeFile
597

Callers

nothing calls this directly

Calls 5

statFunction · 0.85
watchNodeFunction · 0.85
pipeMethod · 0.65
mapMethod · 0.65
registerMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…