Permalink
Browse files

fixes for the funstance event routing

  • Loading branch information...
1 parent b8c06a9 commit 6da02c596fbbcda1da0de5afab50850e0f1f56fe @substack committed Oct 15, 2013
Showing with 6 additions and 5 deletions.
  1. +6 −5 index.js
View
@@ -104,19 +104,20 @@ Airport.prototype.connect = function (opts, fn) {
scan();
var queue = [];
- var target = new EventEmitter;
var closed = false;
+ var target = funstance(new EventEmitter, function (cb) {
+ if (up) up(cb)
+ else queue.push(cb)
+ });
+
target.close = function () {
if (up) up.close();
target.emit('close');
closed = true;
};
- return funstance(target, function (cb) {
- if (up) up(cb)
- else queue.push(cb)
- });
+ return target;
};
Airport.prototype.listen = function () {

0 comments on commit 6da02c5

Please sign in to comment.