mirror of
https://github.com/flarum/framework.git
synced 2025-02-22 23:02:11 +08:00
common: make Evented wrapper arguments into Array
This commit is contained in:
parent
241b8cc99c
commit
fa47228b3f
@ -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);
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user