diff --git a/query/src/lib/utils.ts b/query/src/lib/utils.ts index e35b8a4..70f61e5 100644 --- a/query/src/lib/utils.ts +++ b/query/src/lib/utils.ts @@ -1,6 +1,7 @@ import { + DefaultError, QueryObserverResult, - QueryObserverSuccessResult, + QueryObserverSuccessResult } from '@tanstack/query-core'; import { Observable, Subject, firstValueFrom, takeUntil } from 'rxjs'; @@ -23,9 +24,9 @@ export function toPromise({ return firstValueFrom(source.pipe(signal ? takeUntil(cancel) : (s) => s)); } -export function createSuccessObserverResult( +export function createSuccessObserverResult( data: T, -): QueryObserverResult { +): QueryObserverResult { return { data, isLoading: false, @@ -34,10 +35,10 @@ export function createSuccessObserverResult( isPending: false, isSuccess: true, status: 'success', - } as QueryObserverSuccessResult; + } as QueryObserverSuccessResult; } -export function createPendingObserverResult(): QueryObserverResult { +export function createPendingObserverResult(): QueryObserverResult { return { isError: false, isLoading: true, @@ -46,5 +47,5 @@ export function createPendingObserverResult(): QueryObserverResult { isSuccess: false, fetchStatus: 'fetching', status: 'pending', - } as QueryObserverResult; + } as QueryObserverResult; }