Skip to content

Commit

Permalink
genericquerykey
Browse files Browse the repository at this point in the history
  • Loading branch information
TateB committed Apr 24, 2024
1 parent 2163b78 commit e9a3446
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/@molecules/SearchInput/SearchInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import { createQueryKey } from '@app/hooks/useQueryOptions'
import { useRouterWithHistory } from '@app/hooks/useRouterWithHistory'
import { useValidate, validate } from '@app/hooks/useValidate'
import { useElementSize } from '@app/hooks/useWindowSize'
import { CreateQueryKey } from '@app/types'
import { CreateQueryKey, GenericQueryKey } from '@app/types'
import { useBreakpoint } from '@app/utils/BreakpointProvider'
import { getRegistrationStatus } from '@app/utils/registrationStatus'
import { thread, yearsToSeconds } from '@app/utils/utils'
Expand Down Expand Up @@ -209,7 +209,7 @@ const createQueryDataGetter =
chainId: SupportedChain['id']
address: Address | undefined
}) =>
<TData, TQueryKey extends CreateQueryKey<object, string, 'standard'>>({
<TData, TQueryKey extends GenericQueryKey<'standard'>>({
functionName,
params,
}: {
Expand Down
3 changes: 3 additions & 0 deletions src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,9 @@ export type CreateQueryKey<
scopeKey: string | undefined,
functionName: TFunctionName,
]
export type GenericQueryKey<
TQueryDependencyType extends QueryDependencyType = QueryDependencyType,
> = CreateQueryKey<object, string, TQueryDependencyType>

/**
* Makes {@link TKeys} optional in {@link TType} while preserving type inference.
Expand Down

0 comments on commit e9a3446

Please sign in to comment.