@tanstack/query-core
Advanced tools
Comparing version 4.29.11 to 4.29.14
declare type NotifyCallback = () => void; | ||
declare type NotifyFunction = (callback: () => void) => void; | ||
declare type BatchNotifyFunction = (callback: () => void) => void; | ||
declare type BatchCallsCallback<T extends unknown[]> = (...args: T) => void; | ||
export declare function createNotifyManager(): { | ||
readonly batch: <T>(callback: () => T) => T; | ||
readonly batchCalls: <T_1 extends Function>(callback: T_1) => T_1; | ||
readonly batchCalls: <T_1 extends unknown[]>(callback: BatchCallsCallback<T_1>) => BatchCallsCallback<T_1>; | ||
readonly schedule: (callback: NotifyCallback) => void; | ||
@@ -13,3 +14,3 @@ readonly setNotifyFunction: (fn: NotifyFunction) => void; | ||
readonly batch: <T>(callback: () => T) => T; | ||
readonly batchCalls: <T_1 extends Function>(callback: T_1) => T_1; | ||
readonly batchCalls: <T_1 extends unknown[]>(callback: BatchCallsCallback<T_1>) => BatchCallsCallback<T_1>; | ||
readonly schedule: (callback: NotifyCallback) => void; | ||
@@ -16,0 +17,0 @@ readonly setNotifyFunction: (fn: NotifyFunction) => void; |
{ | ||
"name": "@tanstack/query-core", | ||
"version": "4.29.11", | ||
"version": "4.29.14", | ||
"description": "The framework agnostic core that powers TanStack Query", | ||
@@ -5,0 +5,0 @@ "author": "tannerlinsley", |
@@ -11,2 +11,4 @@ import { scheduleMicrotask } from './utils' | ||
type BatchCallsCallback<T extends unknown[]> = (...args: T) => void | ||
export function createNotifyManager() { | ||
@@ -49,8 +51,10 @@ let queue: NotifyCallback[] = [] | ||
*/ | ||
const batchCalls = <T extends Function>(callback: T): T => { | ||
return ((...args: any[]) => { | ||
const batchCalls = <T extends unknown[]>( | ||
callback: BatchCallsCallback<T>, | ||
): BatchCallsCallback<T> => { | ||
return (...args) => { | ||
schedule(() => { | ||
callback(...args) | ||
}) | ||
}) as any | ||
} | ||
} | ||
@@ -57,0 +61,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2234082
22872
288
2
5
105