diff options
author | dan <dan.abramov@gmail.com> | 2024-04-04 18:57:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-04 18:57:38 +0100 |
commit | b783745b2e4c1b4c3b55892ba05280808e5b370d (patch) | |
tree | 5c3fc20b51496d32934d250186c249de9bf7f515 /src/lib/react-query.tsx | |
parent | b26abf212efc0e50bf85a74d15bf7b5ce350cf5a (diff) | |
download | voidsky-b783745b2e4c1b4c3b55892ba05280808e5b370d.tar.zst |
Extract query key roots to constants (#3404)
* Extract query key roots to constants * Dedupe labelers-detailed-info * Align naming
Diffstat (limited to 'src/lib/react-query.tsx')
-rw-r--r-- | src/lib/react-query.tsx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/react-query.tsx b/src/lib/react-query.tsx index 2fcd46942..be507216a 100644 --- a/src/lib/react-query.tsx +++ b/src/lib/react-query.tsx @@ -11,7 +11,8 @@ import { import {isNative} from '#/platform/detection' // any query keys in this array will be persisted to AsyncStorage -const STORED_CACHE_QUERY_KEYS = ['labelers-detailed-info'] +export const labelersDetailedInfoQueryKeyRoot = 'labelers-detailed-info' +const STORED_CACHE_QUERY_KEY_ROOTS = [labelersDetailedInfoQueryKeyRoot] focusManager.setEventListener(onFocus => { if (isNative) { @@ -65,7 +66,7 @@ const dehydrateOptions: PersistQueryClientProviderProps['persistOptions']['dehyd { shouldDehydrateMutation: (_: any) => false, shouldDehydrateQuery: query => { - return STORED_CACHE_QUERY_KEYS.includes(String(query.queryKey[0])) + return STORED_CACHE_QUERY_KEY_ROOTS.includes(String(query.queryKey[0])) }, } |