Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
HadiKhai committed Mar 28, 2024
1 parent 056ab9c commit 4930e02
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions packages/@justaname.id/react/src/lib/hooks/useSubname.ts
Original file line number Diff line number Diff line change
@@ -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]
Expand All @@ -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<QueryObserverResult<SubnameGetBySubnameResponse | undefined, unknown>>;
}



export const useSubname = (props: UseSubnameOptions) : UseSubnameResult => {
const { justaname, chainId } = useJustaName()

const query = useQuery({
Expand Down

0 comments on commit 4930e02

Please sign in to comment.