Skip to content

Commit

Permalink
fix on and off custom events listener types
Browse files Browse the repository at this point in the history
  • Loading branch information
sergioestevess committed Nov 22, 2024
1 parent ea521fe commit df6d641
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/datatable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1134,15 +1134,15 @@ 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)
}

/**
* 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)
}
Expand Down

0 comments on commit df6d641

Please sign in to comment.