1
0
mirror of https://github.com/flarum/core.git synced 2025-08-05 16:07:34 +02:00

common: make Evented wrapper arguments into Array

This commit is contained in:
David Sevilla Martin
2020-02-23 09:35:59 -05:00
parent 241b8cc99c
commit fa47228b3f

View File

@@ -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);
};