add add monitor action

This commit is contained in:
DD Liu 2017-05-10 17:00:08 -04:00
parent b1355c6b0b
commit b2e0a632e3
4 changed files with 35 additions and 9 deletions
src/engine

View file

@ -249,6 +249,14 @@ class Runtime extends EventEmitter {
return 'MONITORS_REMOVED';
}
/**
* Event name for monitors added.
* @const {string}
*/
static get MONITORS_ADDED () {
return 'MONITORS_ADDED';
}
/**
* How rapidly we try to step threads by default, in ms.
*/
@ -881,6 +889,14 @@ class Runtime extends EventEmitter {
this.emit(Runtime.MONITORS_REMOVED, monitors);
}
/**
* Emit a monitor update which adds if it doesn't already exist the given monitors.
* @param {!Array} monitors Array of monitors to add.
*/
addMonitors (monitors) {
this.emit(Runtime.MONITORS_ADDED, monitors);
}
/**
* Get a target by its id.
* @param {string} targetId Id of target to find.