Skip to content

Fix event hub emits with multiple event args

Paul Slaughter requested to merge fe-fix-incorrect-mitt-usage into master

What does this MR do?

It looks like mitt only supports 1 event arg, where as Vue.$emit will support multiple event args (see epic). Unfortunately, there are some parts of our codebase that got migrated to mitt which use this feature of the Vue API and probably are causing bugs on master 😬

This MR fixes those instances by wrapping the arguments in an array and destructuring on the listener. It's probably not the cleanest looking fix but it's the least invasive 🤷

This MR also fixes some other instances which are using the original Vue based eventHub to support !33973 (closed).

Note

This regex pattern helped me search for instances where there were multiple args passes to emit

emit.+?,[^{]+,
Edited by Paul Slaughter

Merge request reports