Skip to content

Commit

Permalink
Revert "refactor(*): Import noop function from utils"
Browse files Browse the repository at this point in the history
This reverts commit c76f36f.
  • Loading branch information
saul-atomrigs committed Feb 24, 2024
1 parent c76f36f commit 8e26b7b
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 8 deletions.
3 changes: 2 additions & 1 deletion packages/angular-query-experimental/src/inject-mutation.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down Expand Up @@ -65,3 +64,5 @@ export function injectMutation<
>
})
}

function noop() {}
6 changes: 4 additions & 2 deletions packages/query-async-storage-persister/src/asyncThrottle.ts
Original file line number Diff line number Diff line change
@@ -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<TArgs extends ReadonlyArray<unknown>>(
func: (...args: TArgs) => Promise<void>,
{ interval = 1000, onError = noop }: AsyncThrottleOptions = {},
Expand Down
3 changes: 2 additions & 1 deletion packages/query-async-storage-persister/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { noop } from '../../query-core/src/utils'
import { asyncThrottle } from './asyncThrottle'
import type {
AsyncStorage,
Expand Down Expand Up @@ -100,3 +99,5 @@ export const createAsyncStoragePersister = ({
removeClient: noop,
}
}

function noop() {}
3 changes: 2 additions & 1 deletion packages/query-sync-storage-persister/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { noop } from '../../query-core/src/utils'
import type {
PersistRetryer,
PersistedClient,
Expand Down Expand Up @@ -109,3 +108,5 @@ function throttle<TArgs extends Array<any>>(
}
}
}

function noop() {}
3 changes: 2 additions & 1 deletion packages/react-query/src/useMutation.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down Expand Up @@ -64,3 +63,5 @@ export function useMutation<

return { ...result, mutate, mutateAsync: result.mutate }
}

function noop() {}
3 changes: 2 additions & 1 deletion packages/solid-query/src/createMutation.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down Expand Up @@ -75,3 +74,5 @@ export function createMutation<

return state
}

function noop() {}
3 changes: 2 additions & 1 deletion packages/svelte-query/src/createMutation.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down Expand Up @@ -48,3 +47,5 @@ export function createMutation<

return { subscribe }
}

function noop() {}

0 comments on commit 8e26b7b

Please sign in to comment.