Speed up profile loading

This commit is contained in:
Jon Staab
2024-09-10 09:51:03 -07:00
parent 77e8243d8b
commit bece689530
7 changed files with 44 additions and 22 deletions
+3 -3
View File
@@ -1,5 +1,5 @@
import {INBOX_RELAYS, RELAYS, getRelayTags, normalizeRelayUrl, type TrustedEvent} from '@welshman/util'
import {type SubscribeRequest} from "@welshman/net"
import {type SubscribeRequestWithHandlers} from "@welshman/net"
import {deriveEvents, withGetter} from '@welshman/store'
import {load, repository} from './core'
import {collection} from './collection'
@@ -28,7 +28,7 @@ export const {
name: "relaySelections",
store: relaySelections,
getKey: relaySelections => relaySelections.pubkey,
load: (pubkey: string, request: Partial<SubscribeRequest> = {}) =>
load: (pubkey: string, request: Partial<SubscribeRequestWithHandlers> = {}) =>
load({...request, filters: [{kinds: [RELAYS], authors: [pubkey]}]}),
})
@@ -42,6 +42,6 @@ export const {
name: "inboxRelaySelections",
store: inboxRelaySelections,
getKey: inboxRelaySelections => inboxRelaySelections.pubkey,
load: (pubkey: string, request: Partial<SubscribeRequest> = {}) =>
load: (pubkey: string, request: Partial<SubscribeRequestWithHandlers> = {}) =>
load({...request, filters: [{kinds: [INBOX_RELAYS], authors: [pubkey]}]}),
})