useSubscribe, handle emitted requests in sqlite

This commit is contained in:
Martti Malmi
2024-01-18 13:47:07 +02:00
parent b7e61ebde5
commit 2ea516e636
14 changed files with 99 additions and 40 deletions

View File

@ -131,6 +131,10 @@ class InMemoryDB {
}
}
count(filter: Filter): number {
return this.findArray(filter).length;
}
find(filter: Filter, callback: (event: TaggedNostrEvent) => void): void {
this.findArray(filter).forEach(event => {
callback(event);