The-M-Project
The-M-Project copied to clipboard
Syntactial change to bind multiple events to one handler
Right now, if you want to have different event types being bound to one handler, you have to write duplicated code like this:
events: {
tap: {
target: MyApp.MyController,
action: 'doSomething'
},
click: {
target: MyApp.MyController,
action: 'doSomething'
},
}
It would be nice to have the opportunity to avoid this code duplication and write something like this as an alternative form of event binding:
events: {
types: ['click', 'tap'],
handler: {
target: MyApp.MyController,
action: 'doSomething'
}
}
I'm looking forward to your opinions about it.
It is DRYer.