Skip to content

Commit 0d07172

Browse files
ulrichstarkTkDodo
andauthored
chore: remove unnecessary type assertions (#10028)
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
1 parent 64d5d62 commit 0d07172

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

packages/query-core/src/query.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ export class Query<
389389
): Promise<TData> {
390390
if (
391391
this.state.fetchStatus !== 'idle' &&
392-
// If the promise in the retyer is already rejected, we have to definitely
392+
// If the promise in the retryer is already rejected, we have to definitely
393393
// re-start the fetch; there is a chance that the query is still in a
394394
// pending state when that happens
395395
this.#retryer?.status() !== 'rejected'
@@ -735,7 +735,7 @@ function getDefaultState<
735735

736736
const initialDataUpdatedAt = hasData
737737
? typeof options.initialDataUpdatedAt === 'function'
738-
? (options.initialDataUpdatedAt as () => number | undefined)()
738+
? options.initialDataUpdatedAt()
739739
: options.initialDataUpdatedAt
740740
: 0
741741

packages/query-core/src/queryObserver.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import type {
2626
QueryObserverBaseResult,
2727
QueryObserverOptions,
2828
QueryObserverResult,
29-
QueryOptions,
3029
RefetchOptions,
3130
} from './types'
3231

@@ -341,7 +340,7 @@ export class QueryObserver<
341340

342341
// Fetch
343342
let promise: Promise<TQueryData | undefined> = this.#currentQuery.fetch(
344-
this.options as QueryOptions<TQueryFnData, TError, TQueryData, TQueryKey>,
343+
this.options,
345344
fetchOptions,
346345
)
347346

@@ -545,7 +544,7 @@ export class QueryObserver<
545544
}
546545

547546
if (this.#selectError) {
548-
error = this.#selectError as any
547+
error = this.#selectError
549548
data = this.#selectResult
550549
errorUpdatedAt = Date.now()
551550
status = 'error'

packages/query-devtools/src/Devtools.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ import type {
7676
Query,
7777
QueryCache,
7878
QueryCacheNotifyEvent,
79-
QueryState,
8079
} from '@tanstack/query-core'
8180
import type { StorageObject, StorageSetter } from '@solid-primitives/storage'
8281
import type { Accessor, Component, JSX, Setter } from 'solid-js'
@@ -1963,7 +1962,7 @@ const QueryDetails = () => {
19631962
...activeQueryVal.state.fetchMeta,
19641963
__previousQueryOptions,
19651964
} as any,
1966-
} as QueryState<unknown, Error>)
1965+
})
19671966
}
19681967

19691968
const restoreQueryAfterLoadingOrError = () => {
@@ -2199,7 +2198,7 @@ const QueryDetails = () => {
21992198
...activeQueryVal.state.fetchMeta,
22002199
__previousQueryOptions,
22012200
} as any,
2202-
} as QueryState<unknown, Error>)
2201+
})
22032202
}
22042203
}}
22052204
>

0 commit comments

Comments
 (0)