Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle event bubbling #5

Open
arboleya opened this issue Apr 23, 2014 · 0 comments
Open

Handle event bubbling #5

arboleya opened this issue Apr 23, 2014 · 0 comments

Comments

@arboleya
Copy link
Owner

Something like:

var happens = require('happens');

var a = happens();
var b = happens().bubble(a);

a.on('change', function(){
   console.log('changed a');
});

b.on('change', function(){
   console.log('changed b');
});

b.emit('change'); // 1) change b 2) changed a

There needs to be a way to stop the bubbling at any time though. No event (instance) param should be passed along any event handler, for clean signature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant