Skip to content
This repository has been archived by the owner on May 23, 2022. It is now read-only.
/ ekho Public archive

[dead, use shoutout] DOM-agnostic event library + bubbling.

License

Notifications You must be signed in to change notification settings

sorellabs/ekho

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ekho

Build Status Dependencies Status

A DOM-agnostic eventing library with bubbling.

Example

// Inherit from Eventful
var Thing = Eventful.derive({
  say:
  function _say(message) {
    this.trigger('say', message)
  }
})

// Instantiate
var foo = Thing.make()
var bar = Thing.make(foo) // bar events will bubble to foo

// Attach some listeners
foo.on('say', function(a) {
  console.log('foo:', a)
})

bar.on('say', function(a) {
  console.log('bar:', a)
})

// Then trigger the events
bar.say('Hello')
// => bar: Hello
// => foo: Hello

foo.say('Hello')
// => foo: Hello

Installing

$ npm install ekho

Platform support

This library assumes an ES5 environment, but can be easily supported in ES3 platforms by the use of shims. Just include es5-shim :3

browser support

Licence

MIT/X11. i.e.: Do whatever you fucking want, bro.

About

[dead, use shoutout] DOM-agnostic event library + bubbling.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published