Skip to content

Instantly share code, notes, and snippets.

@fczuardi
Last active March 17, 2017 21:24
Show Gist options
  • Save fczuardi/d685c6e762a188f496ff7b8fa066e68f to your computer and use it in GitHub Desktop.
Save fczuardi/d685c6e762a188f496ff7b8fa066e68f to your computer and use it in GitHub Desktop.
const MiniRunner = require('mini-runner')
const argsLength = 1;
var onComplete = new MiniRunner('onComplete', argsLength);
const listenerObject = {
onComplete: function(foo){console.log('aa', foo)}
}
const data = 'Hello runner'
//listenerObject needs to have a 'onComplete' function
onComplete.add(listenerObject);
//emit and all listeners will have their 'onComplete' functions called
onComplete.emit(data);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment