mirror of
https://github.com/thelounge/thelounge.git
synced 2024-05-09 01:36:42 +02:00
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 {Any} [evt] Any value (object is recommended and powerful), passed to each handler.
|
||||
*/
|
||||
emit(type, evt) {
|
||||
emit(type, ...evt) {
|
||||
if (events.has(type)) {
|
||||
events
|
||||
.get(type)
|
||||
.slice()
|
||||
.map((handler) => {
|
||||
handler(evt);
|
||||
handler(...evt);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue