mirror of
https://github.com/flarum/core.git
synced 2025-08-06 00:17:31 +02:00
common: make Evented wrapper arguments into Array
This commit is contained in:
@@ -51,8 +51,8 @@ export default class Evented {
|
|||||||
* @param handler The function to handle the event.
|
* @param handler The function to handle the event.
|
||||||
*/
|
*/
|
||||||
one(event: string, handler: EventHandler): this {
|
one(event: string, handler: EventHandler): this {
|
||||||
const wrapper = function() {
|
const wrapper = function(this: Evented) {
|
||||||
handler.apply(this, arguments);
|
handler.apply(this, Array.from(arguments));
|
||||||
|
|
||||||
this.off(event, wrapper);
|
this.off(event, wrapper);
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user