From df6d641037af556fb3c08976cda8cc57b0ccf070 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Esteves?= Date: Fri, 22 Nov 2024 17:58:06 +0900 Subject: [PATCH] fix on and off custom events listener types --- src/datatable.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/datatable.ts b/src/datatable.ts index e206d52..1f0ef68 100644 --- a/src/datatable.ts +++ b/src/datatable.ts @@ -1134,7 +1134,7 @@ export class DataTable { /** * Add custom event listener */ - on(event: string, callback: () => void) { + on(event: string, callback: (...args: any[]) => void) { this._events[event] = this._events[event] || [] this._events[event].push(callback) } @@ -1142,7 +1142,7 @@ export class DataTable { /** * Remove custom event listener */ - off(event: string, callback: () => void) { + off(event: string, callback: (...args: any[]) => void) { if (event in this._events === false) return this._events[event].splice(this._events[event].indexOf(callback), 1) }