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

Function watch

packages/platform/node-shared/src/NodeFileSystem.ts:726–739  ·  view source on GitHub ↗
(
  backend: Option.Option<FileSystem.WatchBackend["Service"]>,
  path: string,
  options?: FileSystem.WatchOptions
)

Source from the content-addressed store, hash-verified

724 )
725
726const watch = (
727 backend: Option.Option<FileSystem.WatchBackend["Service"]>,
728 path: string,
729 options?: FileSystem.WatchOptions
730) =>
731 Effect.all([stat(path), Effect.serviceOption(FileSystem.WatchBackend)]).pipe(
732 Effect.map(([stat, callerBackend]) =>
733 Option.orElse(callerBackend, () => backend).pipe(
734 Option.flatMap((_) => _.register(path, stat, options)),
735 Option.getOrElse(() => watchNode(path, stat, options))
736 )
737 ),
738 Stream.unwrap
739 )
740
741// == writeFile
742

Callers 1

Calls 6

watchNodeFunction · 0.85
pipeMethod · 0.65
allMethod · 0.65
statFunction · 0.50
mapMethod · 0.45
registerMethod · 0.45

Tested by

no test coverage detected