diff --git a/packages/angular-query-experimental/src/inject-mutation.ts b/packages/angular-query-experimental/src/inject-mutation.ts index 5943351506..41e47411b2 100644 --- a/packages/angular-query-experimental/src/inject-mutation.ts +++ b/packages/angular-query-experimental/src/inject-mutation.ts @@ -1,6 +1,5 @@ import { DestroyRef, computed, effect, inject, signal } from '@angular/core' import { MutationObserver, notifyManager } from '@tanstack/query-core' -import { noop } from '../../query-core/src/utils' import { assertInjector } from './util/assert-injector/assert-injector' import { signalProxy } from './signal-proxy' import { injectQueryClient } from './inject-query-client' @@ -65,3 +64,5 @@ export function injectMutation< > }) } + +function noop() {} diff --git a/packages/query-async-storage-persister/src/asyncThrottle.ts b/packages/query-async-storage-persister/src/asyncThrottle.ts index c295c5eb34..8f5157d56e 100644 --- a/packages/query-async-storage-persister/src/asyncThrottle.ts +++ b/packages/query-async-storage-persister/src/asyncThrottle.ts @@ -1,10 +1,12 @@ -import { noop } from '../../query-core/src/utils' - export interface AsyncThrottleOptions { interval?: number onError?: (error: unknown) => void } +const noop = () => { + /* do nothing */ +} + export function asyncThrottle>( func: (...args: TArgs) => Promise, { interval = 1000, onError = noop }: AsyncThrottleOptions = {}, diff --git a/packages/query-async-storage-persister/src/index.ts b/packages/query-async-storage-persister/src/index.ts index 5dd961aa55..86a11167da 100644 --- a/packages/query-async-storage-persister/src/index.ts +++ b/packages/query-async-storage-persister/src/index.ts @@ -1,4 +1,3 @@ -import { noop } from '../../query-core/src/utils' import { asyncThrottle } from './asyncThrottle' import type { AsyncStorage, @@ -100,3 +99,5 @@ export const createAsyncStoragePersister = ({ removeClient: noop, } } + +function noop() {} diff --git a/packages/query-sync-storage-persister/src/index.ts b/packages/query-sync-storage-persister/src/index.ts index 3c2c75a70d..61d9499430 100644 --- a/packages/query-sync-storage-persister/src/index.ts +++ b/packages/query-sync-storage-persister/src/index.ts @@ -1,4 +1,3 @@ -import { noop } from '../../query-core/src/utils' import type { PersistRetryer, PersistedClient, @@ -109,3 +108,5 @@ function throttle>( } } } + +function noop() {} diff --git a/packages/react-query/src/useMutation.ts b/packages/react-query/src/useMutation.ts index 355c57b500..deb4dd2580 100644 --- a/packages/react-query/src/useMutation.ts +++ b/packages/react-query/src/useMutation.ts @@ -1,7 +1,6 @@ 'use client' import * as React from 'react' import { MutationObserver, notifyManager } from '@tanstack/query-core' -import { noop } from '../../query-core/src/utils' import { useQueryClient } from './QueryClientProvider' import { shouldThrowError } from './utils' import type { @@ -64,3 +63,5 @@ export function useMutation< return { ...result, mutate, mutateAsync: result.mutate } } + +function noop() {} diff --git a/packages/solid-query/src/createMutation.ts b/packages/solid-query/src/createMutation.ts index e885f1a0cc..37bf04091c 100644 --- a/packages/solid-query/src/createMutation.ts +++ b/packages/solid-query/src/createMutation.ts @@ -1,7 +1,6 @@ import { MutationObserver } from '@tanstack/query-core' import { createComputed, createMemo, on, onCleanup } from 'solid-js' import { createStore } from 'solid-js/store' -import { noop } from '../../query-core/src/utils' import { useQueryClient } from './QueryClientProvider' import { shouldThrowError } from './utils' import type { DefaultError } from '@tanstack/query-core' @@ -75,3 +74,5 @@ export function createMutation< return state } + +function noop() {} diff --git a/packages/svelte-query/src/createMutation.ts b/packages/svelte-query/src/createMutation.ts index 071f0f8885..99fcf21117 100644 --- a/packages/svelte-query/src/createMutation.ts +++ b/packages/svelte-query/src/createMutation.ts @@ -1,6 +1,5 @@ import { derived, get, readable } from 'svelte/store' import { MutationObserver, notifyManager } from '@tanstack/query-core' -import { noop } from '../../query-core/src/utils' import { useQueryClient } from './useQueryClient' import { isSvelteStore } from './utils' import type { @@ -48,3 +47,5 @@ export function createMutation< return { subscribe } } + +function noop() {}