Follow conventions for query, use isDirty flag in session store to avoid unneccessary writes
This commit is contained in:
parent
742f53d1ec
commit
b0c9cce5c3
7 changed files with 24 additions and 16 deletions
13
src/state/queries/profile.ts
Normal file
13
src/state/queries/profile.ts
Normal 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
|
||||
},
|
||||
})
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue