Skip to content

Instantly share code, notes, and snippets.

@spolu
Created April 25, 2012 10:08
Show Gist options
  • Save spolu/2488669 to your computer and use it in GitHub Desktop.
Save spolu/2488669 to your computer and use it in GitHub Desktop.
var toto = function(spec, my) {
// ...
var do;
var that = CELL.emitter({});
// ...
do = function() {
that.emit('yeah', [1,2,3], 'hello');
that.emit('yeah', [1,2], 'cool', 123);
that.emit('yeah');
that.emit('foo', 'test', 'hello');
};
// ...
return that;
};
var t = toto({});
t.on('yeah', function(nums, str) {
console.log('ok: ' + nums + ' ' + str);
});
t.do();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment