1.2.0 • Published 8 years ago

ainojs-events v1.2.0

Weekly downloads
17
License
MIT
Repository
github
Last release
8 years ago

Events

Simple event interface, suitable for mixin.

Example:

var GreatStuff = function() {
  // Apply the mixin
  Events.mixin(this)
}

GreatStuff.prototype.whatever = function() {
  this.trigger('whatever', { foo: 'bar' })
}

// [...]

var stuff = new GreatStuff()
stuff.on('whatever', function(e) {
  console.log(e.foo) // "bar"
})
stuff.whatever()

Now your class will implement a simple event interface.

Methods:

on(type, callback)
off(type[, callback])
trigger(type[, params])
once(type, callback)
1.2.0

8 years ago

1.1.3

9 years ago

1.1.2

9 years ago

1.1.1

9 years ago

1.1.0

9 years ago

1.0.10

9 years ago

1.0.9

9 years ago

1.0.8

9 years ago

1.0.7

10 years ago

1.0.6

10 years ago

1.0.5

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago