Skip to content

Instantly share code, notes, and snippets.

Last active August 29, 2015 14:02
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
var dostuffEmitter = new EventEmitter();
dostuffEmitter.on('task1', function (callback) {
dostuffEmitter.emit('task2', x, callback);
dostuffEmitter.on('task2', function (x, callback) {
dostuffEmitter.emit('task3', y, callback);
dostuffEmitter.on('task3', function (y, callback) {
dostuffEmitter.emit('finish', z, callback);
dostuffEmitter.on('finish', function (z, callback) {
if (z < 0) {
} else {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment