Comparing version 1.8.5 to 1.8.6
// Generated by CoffeeScript 1.3.3 | ||
(function() { | ||
var Event, EventEmitter, EventSystem, balUtilFlow, debug, | ||
var Event, EventEmitter, EventEmitterEnhanced, EventSystem, balUtilFlow, debug, | ||
__hasProp = {}.hasOwnProperty, | ||
@@ -14,2 +14,40 @@ __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, | ||
EventEmitterEnhanced = (function(_super) { | ||
__extends(EventEmitterEnhanced, _super); | ||
function EventEmitterEnhanced() { | ||
return EventEmitterEnhanced.__super__.constructor.apply(this, arguments); | ||
} | ||
EventEmitterEnhanced.prototype.emitAsync = function(eventName, data, next) { | ||
var listeners, tasks; | ||
listeners = this.listeners(eventName); | ||
tasks = new balUtilFlow.Group(next); | ||
balUtilFlow.each(listeners, function(listener) { | ||
return tasks.push(function(complete) { | ||
return listener(data, complete); | ||
}); | ||
}); | ||
tasks.async(); | ||
return this; | ||
}; | ||
EventEmitterEnhanced.prototype.emitSync = function(eventName, data, next) { | ||
var listeners, tasks; | ||
listeners = this.listeners(eventName); | ||
tasks = new balUtilFlow.Group(next); | ||
balUtilFlow.each(listeners, function(listener) { | ||
return tasks.push(function(complete) { | ||
return listener(data, complete); | ||
}); | ||
}); | ||
tasks.sync(); | ||
return this; | ||
}; | ||
return EventEmitterEnhanced; | ||
})(EventEmitter); | ||
Event = (function() { | ||
@@ -232,33 +270,8 @@ | ||
EventSystem.prototype.emitAsync = function(eventName, data, next) { | ||
var listeners, tasks; | ||
listeners = this.listeners(eventName); | ||
tasks = new balUtilFlow.Group(next); | ||
balUtilFlow.each(listeners, function(listener) { | ||
return tasks.push(function(complete) { | ||
return listener(data, complete); | ||
}); | ||
}); | ||
tasks.async(); | ||
return this; | ||
}; | ||
EventSystem.prototype.emitSync = function(eventName, data, next) { | ||
var listeners, tasks; | ||
listeners = this.listeners(eventName); | ||
tasks = new balUtilFlow.Group(next); | ||
balUtilFlow.each(listeners, function(listener) { | ||
return tasks.push(function(complete) { | ||
return listener(data, complete); | ||
}); | ||
}); | ||
tasks.sync(); | ||
return this; | ||
}; | ||
return EventSystem; | ||
})(EventEmitter); | ||
})(EventEmitterEnhanced); | ||
module.exports = { | ||
EventEmitterEnhanced: EventEmitterEnhanced, | ||
Event: Event, | ||
@@ -265,0 +278,0 @@ EventSystem: EventSystem |
{ | ||
"name": "bal-util", | ||
"version": "1.8.5", | ||
"version": "1.8.6", | ||
"description": "Common utility functions for Node.js used and maintained by Benjamin Lupton", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/balupton/bal-util", |
56839
1685