De-closure list-members
This commit is contained in:
@@ -19,15 +19,24 @@ export function useListMembersQuery(uri: string) {
|
|||||||
>({
|
>({
|
||||||
staleTime: STALE.MINUTES.ONE,
|
staleTime: STALE.MINUTES.ONE,
|
||||||
queryKey: RQKEY(uri),
|
queryKey: RQKEY(uri),
|
||||||
async queryFn({pageParam}: {pageParam: RQPageParam}) {
|
queryFn: listMembersQueryFn,
|
||||||
|
initialPageParam: undefined,
|
||||||
|
getNextPageParam: lastPage => lastPage.cursor,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
async function listMembersQueryFn({
|
||||||
|
queryKey,
|
||||||
|
pageParam,
|
||||||
|
}: {
|
||||||
|
queryKey: QueryKey
|
||||||
|
pageParam: RQPageParam
|
||||||
|
}) {
|
||||||
|
const [_, uri] = queryKey as ReturnType<typeof RQKEY>
|
||||||
const res = await getAgent().app.bsky.graph.getList({
|
const res = await getAgent().app.bsky.graph.getList({
|
||||||
list: uri,
|
list: uri,
|
||||||
limit: PAGE_SIZE,
|
limit: PAGE_SIZE,
|
||||||
cursor: pageParam,
|
cursor: pageParam,
|
||||||
})
|
})
|
||||||
return res.data
|
return res.data
|
||||||
},
|
|
||||||
initialPageParam: undefined,
|
|
||||||
getNextPageParam: lastPage => lastPage.cursor,
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user