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

Function watch

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

Source from the content-addressed store, hash-verified

425 )
426
427const watch = (
428 backend: Option.Option<FileSystem.WatchBackend["Service"]>,
429 path: string,
430 options?: FileSystem.WatchOptions
431) =>
432 stat(path).pipe(
433 Effect.map((info) =>
434 backend.pipe(
435 Option.flatMap((backend) => backend.register(path, info, options)),
436 Option.getOrElse(() => watchNative(path, options))
437 )
438 ),
439 Stream.unwrap
440 )
441
442const writeFile: FileSystem.FileSystem["writeFile"] = (path, data, options) => {
443 const flag = options?.flag ?? "w"

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected