MCPcopy Create free account
hub / github.com/arctic-cli/interface / subscribe

Function subscribe

packages/arctic/src/file/watcher.ts:64–71  ·  view source on GitHub ↗
(err, evts)

Source from the content-addressed store, hash-verified

62 }
63 log.info("watcher backend", { platform: process.platform, backend })
64 const subscribe: ParcelWatcher.SubscribeCallback = (err, evts) => {
65 if (err) return
66 for (const evt of evts) {
67 if (evt.type === "create") Bus.publish(Event.Updated, { file: evt.path, event: "add" })
68 if (evt.type === "update") Bus.publish(Event.Updated, { file: evt.path, event: "change" })
69 if (evt.type === "delete") Bus.publish(Event.Updated, { file: evt.path, event: "unlink" })
70 }
71 }
72
73 const subs = []
74 const cfgIgnores = cfg.watcher?.ignore ?? []

Callers

nothing calls this directly

Calls 1

publishMethod · 0.45

Tested by

no test coverage detected