Last active
March 17, 2017 21:24
-
-
Save fczuardi/d685c6e762a188f496ff7b8fa066e68f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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