Add a few thunk utils

This commit is contained in:
Jon Staab
2024-12-10 08:21:14 -08:00
parent caccc43f03
commit 9ab8b70bb9
2 changed files with 21 additions and 0 deletions
+7
View File
@@ -29,6 +29,13 @@ export class Tracker extends Emitter {
this.emit('update')
}
removeRelay = (eventId: string, relay: string) => {
this.relaysById.get(eventId)?.delete(relay)
this.idsByRelay.get(relay)?.delete(eventId)
this.emit('update')
}
track = (eventId: string, relay: string) => {
const seen = this.relaysById.has(eventId)