Skip to content

Commit

Permalink
emitter cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Mar 24, 2014
1 parent d5a0830 commit d2cf1de
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions src/compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -321,12 +321,11 @@ CompilerProto.setupObserver = function () {
var compiler = this,
bindings = compiler.bindings,
options = compiler.options,
observer = compiler.observer = new Emitter()
observer = compiler.observer = new Emitter(compiler.vm)

// a hash to hold event proxies for each root level key
// so they can be referenced and removed later
observer.proxies = {}
observer._ctx = compiler.vm

// add own listeners which trigger binding updates
observer
Expand Down
6 changes: 3 additions & 3 deletions src/emitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ EmitterProto.on = function(event, fn){
return this
}

Emitter.prototype.once = function(event, fn){
EmitterProto.once = function(event, fn){
var self = this
this._cbs = this._cbs || {}

Expand All @@ -25,7 +25,7 @@ Emitter.prototype.once = function(event, fn){
return this
}

Emitter.prototype.off = function(event, fn){
EmitterProto.off = function(event, fn){
this._cbs = this._cbs || {}

// all
Expand Down Expand Up @@ -56,7 +56,7 @@ Emitter.prototype.off = function(event, fn){
return this
}

Emitter.prototype.emit = function(event, a, b, c){
EmitterProto.emit = function(event, a, b, c){
this._cbs = this._cbs || {}
var callbacks = this._cbs[event]

Expand Down

0 comments on commit d2cf1de

Please sign in to comment.