UNPKG

@mathquis/node-assistant-protocol

Version:
16 lines 387 B
module.exports = (hermes, logger) => { return (topic, object) => { return { ...object, muteChanged: async (siteId, muted) => { logger.debug('%s muted on site "%s" changed to %s', object.name, siteId, muted) await hermes.publish(topic, hermes.serialize({ siteId, muted })) }, onMuteChanged: (handler) => { return hermes.on(topic, handler) } } } }