Skip to content

Commit

Permalink
fix: changed name of T
Browse files Browse the repository at this point in the history
  • Loading branch information
eirikhaugstulen authored and kabaros committed May 1, 2023
1 parent 3bf86d6 commit a5d527d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions services/data/src/react/hooks/useDataQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ type QueryState = {
refetchCallback?: (data: any) => void
}

export const useDataQuery = <T = QueryResult>(
export const useDataQuery = <TQueryResult = QueryResult>(
query: Query,
{
onComplete: userOnSuccess,
onError: userOnError,
variables: initialVariables = {},
lazy: initialLazy = false,
}: QueryOptions = {}
): QueryRenderInput<T> => {
): QueryRenderInput<TQueryResult> => {
const [staticQuery] = useStaticInput<Query>(query, {
warn: true,
name: 'query',
Expand Down
6 changes: 3 additions & 3 deletions services/data/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ export interface ExecuteHookResult<ReturnType> {
data?: ReturnType
}

export interface QueryState<T> {
export interface QueryState<TQueryResult> {
called: boolean
loading: boolean
fetching: boolean
error?: FetchError
data?: T
data?: TQueryResult
}

export interface QueryRenderInput<T = QueryResult> extends QueryState<T> {
export interface QueryRenderInput<TQueryResult = QueryResult> extends QueryState<TQueryResult> {
engine: DataEngine
refetch: QueryRefetchFunction
}
Expand Down

0 comments on commit a5d527d

Please sign in to comment.