MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / addRemovedEvent

Function addRemovedEvent

__tests__/sync-synthesis-interval.test.ts:48–51  ·  view source on GitHub ↗

A second event on the bus: the edit that makes a sync rebuild the synthesized edges.

(dir: string)

Source from the content-addressed store, hash-verified

46
47/** A second event on the bus: the edit that makes a sync rebuild the synthesized edges. */
48function addRemovedEvent(dir: string): void {
49 write(dir, 'src/handlers.js', "const { bus } = require('./bus');\nfunction onSaved(doc) { return doc; }\nfunction onRemoved(doc) { return doc; }\nbus.on('saved', onSaved);\nbus.on('removed', onRemoved);\nmodule.exports = { onSaved, onRemoved };\n");
50 write(dir, 'src/service.js', "const { bus } = require('./bus');\nfunction save(doc) { bus.emit('saved', doc); return doc; }\nfunction remove(doc) { bus.emit('removed', doc); return doc; }\nmodule.exports = { save, remove };\n");
51}
52
53/** `synthesis_pending` as stored, read through a connection of its own. */
54function pending(dir: string): string | null {

Callers 1

Calls 1

writeFunction · 0.70

Tested by

no test coverage detected