update api for modules, add n-series pause, update notes

This commit is contained in:
Stewart Allen 2018-03-05 10:38:21 -05:00
commit 8d03dd53de
6 changed files with 26 additions and 16 deletions

View file

@ -551,12 +551,15 @@ self.kiri.license = exports.LICENSE;
******************************************************************* */
function sendOnEvent(name, data) {
if (name && onEvent[name]) onEvent[name](data);
if (name && onEvent[name]) onEvent[name].forEach(function(fn) {
fn(data);
});
}
function addOnEvent(name, handler) {
if (name && typeof(name) === 'string' && typeof(handler) === 'function') {
onEvent[name] = handler;
onEvent[name] = onEvent[name] || [];
onEvent[name].push(handler);
}
}