Permalink
Browse files

instead of localRef use an opts.wrapper param

  • Loading branch information...
1 parent 70fe7e4 commit 4897504e58be21fd7f80b0304ecc82a45dc965d0 @substack committed Jun 20, 2012
Showing with 5 additions and 7 deletions.
  1. +5 −7 index.js
View
@@ -14,17 +14,14 @@ module.exports = function (cons) {
}
})();
-function Proto (cons, localRef) {
+function Proto (cons, opts) {
var self = this;
EventEmitter.call(self);
+ if (!opts) opts = {};
self.remote = {};
- self.callbacks = {
- local : localRef || [],
- remote : []
- };
-
- self.scrubber = scrubber(self.callbacks.local);
+ self.callbacks = { local : [], remote : [] };
+ self.scrubber = scrubber(self.callbacks.local, opts.wrapper);
if (typeof cons === 'function') {
self.instance = new cons(self.remote, self);
@@ -37,6 +34,7 @@ Proto.prototype.start = function () {
};
Proto.prototype.cull = function (id) {
+ delete this.callbacks.local[id];
this.emit('request', {
method : 'cull',
arguments : [ id ]

0 comments on commit 4897504

Please sign in to comment.