Skip to content

$on with an array of events #4856

@markbrown4

Description

@markbrown4

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)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions