Skip to content

$on with an array of events #4856

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

Closed
markbrown4 opened this issue Feb 5, 2017 · 1 comment
Closed

$on with an array of events #4856

markbrown4 opened this issue Feb 5, 2017 · 1 comment

Comments

@markbrown4
Copy link

markbrown4 commented Feb 5, 2017

Would be neat if $on supported an array of events:

bus.$on(['CLICK_BODY', 'KEYUP_ESCAPE'], () => {
  this.active = false
})

Without it we need duplication

bus.$on('CLICK_BODY', () => {
  this.active = false
})
bus.$on('KEYUP_ESCAPE', () => {
  this.active = false
})

// or

bus.$on('CLICK_BODY', deactivate)
bus.$on('KEYUP_ESCAPE', deactivate)
@yyx990803
Copy link
Member

Closed via #4860

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

3 participants