Follow conventions for query, use isDirty flag in session store to avoid unneccessary writes

This commit is contained in:
Eric Bailey 2023-11-10 08:46:45 -06:00
parent 742f53d1ec
commit b0c9cce5c3
7 changed files with 24 additions and 16 deletions

View file

@ -0,0 +1,13 @@
import {useQuery} from '@tanstack/react-query'
import {PUBLIC_BSKY_AGENT} from '#/state/queries'
export function useProfileQuery({did}: {did: string}) {
return useQuery({
queryKey: ['getProfile', did],
queryFn: async () => {
const res = await PUBLIC_BSKY_AGENT.getProfile({actor: did})
return res.data
},
})
}