Skip to content

Commit

Permalink
add event off method
Browse files Browse the repository at this point in the history
  • Loading branch information
vinikjkkj committed Aug 10, 2024
1 parent 0adbe36 commit 4b79fbd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/utils/emitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ export class CacheEmitter {
on<Event extends keyof CacheEvents>(event: Event, listener: CacheEvents[Event]) {
return this._emitter.on(event, listener)
}

off<Event extends keyof CacheEvents>(event: Event, listener: CacheEvents[Event]) {
return this._emitter.off(event, listener)
}
}

export class CachePoolEmitter {
Expand All @@ -31,4 +35,8 @@ export class CachePoolEmitter {
on<Event extends keyof CachePoolEvents>(event: Event, listener: CachePoolEvents[Event]) {
return this._emitter.on(event, listener)
}

off<Event extends keyof CachePoolEvents>(event: Event, listener: CachePoolEvents[Event]) {
return this._emitter.off(event, listener)
}
}

0 comments on commit 4b79fbd

Please sign in to comment.