Speed up loading

This commit is contained in:
Jon Staab
2025-04-07 16:13:13 -07:00
parent 7fe58f4bdf
commit 7cb8033334
9 changed files with 103 additions and 103 deletions
+3 -9
View File
@@ -5,7 +5,7 @@ import {deriveEventsMapped} from "@welshman/store"
import {repository} from "./core.js"
import {Router} from "./router.js"
import {collection} from "./collection.js"
import {loadRelaySelections} from "./relaySelections.js"
import {loadWithAsapMetaRelayUrls} from "./relaySelections.js"
export const follows = deriveEventsMapped<PublishedList>(repository, {
filters: [{kinds: [FOLLOWS]}],
@@ -21,12 +21,6 @@ export const {
name: "follows",
store: follows,
getKey: follows => follows.event.pubkey,
load: async (pubkey: string, request: Partial<MultiRequestOptions> = {}) => {
await loadRelaySelections(pubkey, request)
const filters = [{kinds: [FOLLOWS], authors: [pubkey]}]
const relays = Router.get().FromPubkey(pubkey).getUrls()
await load({relays, ...request, filters})
},
load: (pubkey: string, relays: string[]) =>
loadWithAsapMetaRelayUrls(pubkey, relays, [{kinds: [FOLLOWS], authors: [pubkey]}]),
})