Migrate collections to new stores, change some conventions
This commit is contained in:
@@ -2,7 +2,7 @@ import {derived, readable} from "svelte/store"
|
||||
import {readProfile, displayProfile, displayPubkey, PROFILE} from "@welshman/util"
|
||||
import {deriveItemsByKey, deriveItems, makeForceLoadItem, makeLoadItem, makeDeriveItem, getter} from "@welshman/store"
|
||||
import {repository} from "./core.js"
|
||||
import {makeOutboxLoaderWithIndexers} from "./relaySelections.js"
|
||||
import {makeOutboxLoaderWithIndexers} from "./relayLists.js"
|
||||
|
||||
export const profilesByPubkey = deriveItemsByKey({
|
||||
repository,
|
||||
@@ -15,6 +15,8 @@ export const profiles = deriveItems(profilesByPubkey)
|
||||
|
||||
export const getProfilesByPubkey = getter(profilesByPubkey)
|
||||
|
||||
export const getProfiles = getter(profiles)
|
||||
|
||||
export const getProfile = (pubkey: string) => getProfilesByPubkey().get(pubkey)
|
||||
|
||||
export const forceLoadProfile = makeForceLoadItem(makeOutboxLoaderWithIndexers(PROFILE), getProfile)
|
||||
|
||||
Reference in New Issue
Block a user