A second event on the bus: the edit that makes a sync rebuild the synthesized edges.
(dir: string)
| 46 | |
| 47 | /** A second event on the bus: the edit that makes a sync rebuild the synthesized edges. */ |
| 48 | function 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. */ |
| 54 | function pending(dir: string): string | null { |
no test coverage detected