Support multiple arguments in eventbus emit
Fixes confirm dialog callback
This commit is contained in:
parent
16646e1586
commit
61d8884bef
@ -36,13 +36,13 @@ class EventBus {
|
|||||||
* @param {String} type The event type to invoke.
|
* @param {String} type The event type to invoke.
|
||||||
* @param {Any} [evt] Any value (object is recommended and powerful), passed to each handler.
|
* @param {Any} [evt] Any value (object is recommended and powerful), passed to each handler.
|
||||||
*/
|
*/
|
||||||
emit(type, evt) {
|
emit(type, ...evt) {
|
||||||
if (events.has(type)) {
|
if (events.has(type)) {
|
||||||
events
|
events
|
||||||
.get(type)
|
.get(type)
|
||||||
.slice()
|
.slice()
|
||||||
.map((handler) => {
|
.map((handler) => {
|
||||||
handler(evt);
|
handler(...evt);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user