Slim down some things
This commit is contained in:
+12
-18
@@ -1,24 +1,22 @@
|
||||
import {MUTES, getListValues, asDecryptedEvent, readList} from '@welshman/util'
|
||||
import {MUTES, asDecryptedEvent, readList} from '@welshman/util'
|
||||
import {type TrustedEvent, type PublishedList} from '@welshman/util'
|
||||
import {type SubscribeRequestWithHandlers} from "@welshman/net"
|
||||
import {deriveEventsMapped, withGetter} from '@welshman/store'
|
||||
import {deriveEventsMapped} from '@welshman/store'
|
||||
import {repository, load} from './core'
|
||||
import {collection} from './collection'
|
||||
import {ensurePlaintext} from './plaintext'
|
||||
import {loadRelaySelections} from './relaySelections'
|
||||
|
||||
export const mutes = withGetter(
|
||||
deriveEventsMapped<PublishedList>(repository, {
|
||||
filters: [{kinds: [MUTES]}],
|
||||
itemToEvent: item => item.event,
|
||||
eventToItem: async (event: TrustedEvent) =>
|
||||
readList(
|
||||
asDecryptedEvent(event, {
|
||||
content: await ensurePlaintext(event),
|
||||
}),
|
||||
),
|
||||
})
|
||||
)
|
||||
export const mutes = deriveEventsMapped<PublishedList>(repository, {
|
||||
filters: [{kinds: [MUTES]}],
|
||||
itemToEvent: item => item.event,
|
||||
eventToItem: async (event: TrustedEvent) =>
|
||||
readList(
|
||||
asDecryptedEvent(event, {
|
||||
content: await ensurePlaintext(event),
|
||||
}),
|
||||
),
|
||||
})
|
||||
|
||||
export const {
|
||||
indexStore: mutesByPubkey,
|
||||
@@ -34,7 +32,3 @@ export const {
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
export const getMutes = (pubkey: string) =>
|
||||
getListValues("p", mutesByPubkey.get().get(pubkey))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user