From 4930e02e561d67acb561368de4b4dd7275fbc3bd Mon Sep 17 00:00:00 2001 From: HadiKhai Date: Thu, 28 Mar 2024 02:03:28 +0200 Subject: [PATCH] fix --- .../@justaname.id/react/src/lib/hooks/useSubname.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/@justaname.id/react/src/lib/hooks/useSubname.ts b/packages/@justaname.id/react/src/lib/hooks/useSubname.ts index 34c7e2a8..ea4ca845 100644 --- a/packages/@justaname.id/react/src/lib/hooks/useSubname.ts +++ b/packages/@justaname.id/react/src/lib/hooks/useSubname.ts @@ -1,5 +1,6 @@ import { useJustaName } from '../providers'; -import { useQuery } from '@tanstack/react-query'; +import { QueryObserverResult, RefetchOptions, useQuery } from '@tanstack/react-query'; +import { SubnameGetBySubnameResponse } from '@justaname.id/sdk'; export const buildSubnameBySubnameKey = (subname: string) => ['SUBNAME_BY_SUBNAME', subname] @@ -8,7 +9,15 @@ export interface UseSubnameOptions { subname: string; } -export const useSubname = (props: UseSubnameOptions) => { +interface UseSubnameResult { + subname: SubnameGetBySubnameResponse | undefined; + isLoading: boolean; + refetchSubname: (options?: RefetchOptions | undefined) => Promise>; +} + + + +export const useSubname = (props: UseSubnameOptions) : UseSubnameResult => { const { justaname, chainId } = useJustaName() const query = useQuery({