mirror of
https://github.com/flarum/core.git
synced 2025-08-05 07:57:46 +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.
|
||||
*/
|
||||
one(event: string, handler: EventHandler): this {
|
||||
const wrapper = function() {
|
||||
handler.apply(this, arguments);
|
||||
const wrapper = function(this: Evented) {
|
||||
handler.apply(this, Array.from(arguments));
|
||||
|
||||
this.off(event, wrapper);
|
||||
};
|
||||
|
Reference in New Issue
Block a user