DRY map lookup
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
91ba939e23
commit
152499a17d
1 changed files with 1 additions and 1 deletions
|
@ -310,7 +310,7 @@ const stateHandlers = {
|
|||
|
||||
module.exports = {
|
||||
textForEvent: function(ev) {
|
||||
const handler = ev.isState() ? stateHandlers[ev.getType()] : handlers[ev.getType()];
|
||||
const handler = (ev.isState() ? stateHandlers : handlers)[ev.getType()];
|
||||
if (handler) return handler(ev);
|
||||
return '';
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue