Skip to content

Commit a693166

Browse files
ci: apply automated fixes
1 parent f940937 commit a693166

File tree

3 files changed

+8
-21
lines changed

3 files changed

+8
-21
lines changed

packages/query-core/src/query.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,7 @@ export class Query<
254254

255255
isActive(): boolean {
256256
return this.observers.some(
257-
(observer) =>
258-
resolveOption(observer.options.enabled, this) !== false,
257+
(observer) => resolveOption(observer.options.enabled, this) !== false,
259258
)
260259
}
261260

packages/query-core/src/queryClient.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,7 @@ export class QueryClient {
155155

156156
if (
157157
options.revalidateIfStale &&
158-
query.isStaleByTime(
159-
resolveOption(defaultedOptions.staleTime, query),
160-
)
158+
query.isStaleByTime(resolveOption(defaultedOptions.staleTime, query))
161159
) {
162160
void this.prefetchQuery(defaultedOptions)
163161
}

packages/query-core/src/queryObserver.ts

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,8 @@ export class QueryObserver<
155155
this.options.enabled !== undefined &&
156156
typeof this.options.enabled !== 'boolean' &&
157157
typeof this.options.enabled !== 'function' &&
158-
typeof resolveOption(
159-
this.options.enabled,
160-
this.#currentQuery,
161-
) !== 'boolean'
158+
typeof resolveOption(this.options.enabled, this.#currentQuery) !==
159+
'boolean'
162160
) {
163161
throw new Error(
164162
'Expected enabled to be a boolean or a callback that returns a boolean',
@@ -344,10 +342,7 @@ export class QueryObserver<
344342

345343
#updateStaleTimeout(): void {
346344
this.#clearStaleTimeout()
347-
const staleTime = resolveOption(
348-
this.options.staleTime,
349-
this.#currentQuery,
350-
)
345+
const staleTime = resolveOption(this.options.staleTime, this.#currentQuery)
351346

352347
if (isServer || this.#currentResult.isStale || !isValidTimeout(staleTime)) {
353348
return
@@ -368,10 +363,7 @@ export class QueryObserver<
368363

369364
#computeRefetchInterval() {
370365
return (
371-
resolveOption(
372-
this.options.refetchInterval,
373-
this.#currentQuery,
374-
) ?? false
366+
resolveOption(this.options.refetchInterval, this.#currentQuery) ?? false
375367
)
376368
}
377369

@@ -382,8 +374,7 @@ export class QueryObserver<
382374

383375
if (
384376
isServer ||
385-
resolveOption(this.options.enabled, this.#currentQuery) ===
386-
false ||
377+
resolveOption(this.options.enabled, this.#currentQuery) === false ||
387378
!isValidTimeout(this.#currentRefetchInterval) ||
388379
this.#currentRefetchInterval === 0
389380
) {
@@ -658,8 +649,7 @@ export class QueryObserver<
658649
}
659650

660651
const { notifyOnChangeProps } = this.options
661-
const notifyOnChangePropsValue =
662-
resolveOption(notifyOnChangeProps)
652+
const notifyOnChangePropsValue = resolveOption(notifyOnChangeProps)
663653

664654
if (
665655
notifyOnChangePropsValue === 'all' ||

0 commit comments

Comments
 (0)