Skip to content

Instantly share code, notes, and snippets.

@lsmith
Created October 16, 2009 05:48
Show Gist options
  • Select an option

  • Save lsmith/211596 to your computer and use it in GitHub Desktop.

Select an option

Save lsmith/211596 to your computer and use it in GitHub Desktop.
function increment() {
count++;
}
var a = new Y.EventTarget(),
b = new Y.EventTarget({
bubbles: true,
emitFacade: true,
prefix: 'foo'
}),
count = 0;
b.addTarget(a);
a.on('foo:bar', increment);
b.on('bar', increment);
b.fire('bar');
alert(count);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment