UNPKG

connect-platform

Version:

A platform to build backened code mostly in a visual manner.

24 lines (18 loc) 443 B
const { WatcherEvents, Watcher } = require('./watcher'); class CompositeWatcher extends Watcher { constructor(events) { super(events); this._mounted = {}; } mount(tag, watcher) { this._mounted[tag] = watcher; watcher.watched(event => { this.publish(WatcherEvents.watched, { tag: tag, cascaded: event, }); }); return this; } } module.exports.CompositeWatcher = CompositeWatcher;