Caching heuristics (#1938)

* Tempfix profile load

* First pass at staleTime
This commit is contained in:
Eric Bailey
2023-11-16 17:28:50 -06:00
committed by GitHub
parent f89dc63801
commit 6dfb2a232f
30 changed files with 122 additions and 22 deletions
+2
View File
@@ -14,6 +14,7 @@ import {
import {useSession} from '#/state/session'
import {useModerationOpts} from '#/state/queries/preferences'
import {STALE} from '#/state/queries'
const suggestedFollowsQueryKey = ['suggested-follows']
const suggestedFollowsByActorQueryKey = (did: string) => [
@@ -33,6 +34,7 @@ export function useSuggestedFollowsQuery() {
string | undefined
>({
enabled: !!moderationOpts,
staleTime: STALE.INFINITY,
queryKey: suggestedFollowsQueryKey,
queryFn: async ({pageParam}) => {
const res = await agent.app.bsky.actor.getSuggestions({