Added args option for chaining

This commit is contained in:
2023-11-17 16:08:54 +02:00
parent ce943aa1cb
commit 569f0add3d
2 changed files with 3 additions and 3 deletions

View File

@ -1899,8 +1899,8 @@ export class UserAPI {
// =============================================================
register = (name: string, operation: EventOperation<AbstractEvent>): void => {
AbstractEvent.prototype[name] = function (this: AbstractEvent) {
return operation(this);
AbstractEvent.prototype[name] = function (this: AbstractEvent, ...args: any[]) {
return operation(this, ...args);
};
}

View File

@ -5,7 +5,7 @@ import {
safeScale
} from "zifferjs";
export type EventOperation<T> = (instance: T) => void;
export type EventOperation<T> = (instance: T, ...args: any[]) => void;
export interface AbstractEvent {
[key: string]: any