Extract query key roots to constants (#3404)
* Extract query key roots to constants * Dedupe labelers-detailed-info * Align naming
This commit is contained in:
@@ -1,11 +1,16 @@
|
||||
import React from 'react'
|
||||
import {useQueryClient, useMutation} from '@tanstack/react-query'
|
||||
import {useMutation, useQueryClient} from '@tanstack/react-query'
|
||||
|
||||
import {getAgent} from '#/state/session'
|
||||
import {STALE} from '#/state/queries'
|
||||
import {getAgent} from '#/state/session'
|
||||
|
||||
const fetchHandleQueryKey = (handleOrDid: string) => ['handle', handleOrDid]
|
||||
const fetchDidQueryKey = (handleOrDid: string) => ['did', handleOrDid]
|
||||
const handleQueryKeyRoot = 'handle'
|
||||
const fetchHandleQueryKey = (handleOrDid: string) => [
|
||||
handleQueryKeyRoot,
|
||||
handleOrDid,
|
||||
]
|
||||
const didQueryKeyRoot = 'did'
|
||||
const fetchDidQueryKey = (handleOrDid: string) => [didQueryKeyRoot, handleOrDid]
|
||||
|
||||
export function useFetchHandle() {
|
||||
const queryClient = useQueryClient()
|
||||
|
||||
Reference in New Issue
Block a user