Fix tags again, tweak feeds and stores

This commit is contained in:
Jon Staab
2024-05-09 16:00:09 -07:00
parent 9f70d8643e
commit fddee3c6ee
7 changed files with 66 additions and 46 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
import {throttle} from 'throttle-debounce'
import type {Readable, Subscriber, Invalidator} from '@welshman/lib'
import type {IReadable, Subscriber, Invalidator} from '@welshman/lib'
import {Derived, Emitter, writable, first, always, chunk, sleep, uniq, omit, now, range, identity} from '@welshman/lib'
import {Kind} from './Kinds'
import {matchFilter, getIdFilters, matchFilters} from './Filters'
@@ -16,7 +16,7 @@ export type RepositoryOptions = {
throttle?: number
}
export class Repository<E extends Rumor> extends Emitter implements Readable<Repository<E>> {
export class Repository<E extends Rumor> extends Emitter implements IReadable<Repository<E>> {
eventsById = new Map<string, E>()
eventsByAddress = new Map<string, E>()
eventsByTag = new Map<string, E[]>()
+1 -1
View File
@@ -108,7 +108,7 @@ export class Tags extends (Fluent<Tag> as OmitStatics<typeof Fluent<Tag>, 'from'
// Add different types separately so positional logic works
dispatchTags(tags.whereKey("e"))
dispatchTags(tags.whereKey("a"))
dispatchTags(tags.whereKey("a").filter(t => Boolean(t.nth(3))))
mentionTags.forEach((t: Tag) => mentions.push(t.valueOf()))
return {