Speed up loading
This commit is contained in:
@@ -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]}]),
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user