Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@tanstack/react-query

Package Overview
Dependencies
Maintainers
2
Versions
365
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tanstack/react-query - npm Package Compare versions

Comparing version 5.62.16 to 5.63.0

5

build/legacy/types.d.ts

@@ -5,2 +5,7 @@ import { DefaultError, QueryKey, QueryObserverOptions, OmitKeyof, SkipToken, InfiniteQueryObserverOptions, QueryObserverResult, DefinedQueryObserverResult, InfiniteQueryObserverResult, DefinedInfiniteQueryObserverResult, MutationObserverOptions, MutateFunction, Override, MutationObserverResult } from '@tanstack/query-core';

interface UseBaseQueryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> extends QueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey> {
/**
* Set this to `false` to unsubscribe this observer from updates to the query cache.
* Defaults to `true`.
*/
subscribed?: boolean;
}

@@ -7,0 +12,0 @@ type AnyUseQueryOptions = UseQueryOptions<any, any, any, any>;

5

build/legacy/useBaseQuery.js

@@ -50,10 +50,11 @@ "use client";

const result = observer.getOptimisticResult(defaultedOptions);
const shouldSubscribe = !isRestoring && options.subscribed !== false;
React.useSyncExternalStore(
React.useCallback(
(onStoreChange) => {
const unsubscribe = isRestoring ? noop : observer.subscribe(notifyManager.batchCalls(onStoreChange));
const unsubscribe = shouldSubscribe ? observer.subscribe(notifyManager.batchCalls(onStoreChange)) : noop;
observer.updateResult();
return unsubscribe;
},
[observer, isRestoring]
[observer, shouldSubscribe]
),

@@ -60,0 +61,0 @@ () => observer.getCurrentResult(),

3

build/legacy/useQueries.d.ts
import { UseQueryResult, UseQueryOptions, DefinedUseQueryResult } from './types.js';
import { DefaultError, QueryClient, QueryKey, OmitKeyof, QueriesPlaceholderDataFunction, QueryFunction, ThrowOnError } from '@tanstack/query-core';
type UseQueryOptionsForUseQueries<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> = OmitKeyof<UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>, 'placeholderData'> & {
type UseQueryOptionsForUseQueries<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> = OmitKeyof<UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>, 'placeholderData' | 'subscribed'> & {
placeholderData?: TQueryFnData | QueriesPlaceholderDataFunction<TQueryFnData>;

@@ -69,4 +69,5 @@ };

combine?: (result: QueriesResults<T>) => TCombinedResult;
subscribed?: boolean;
}, queryClient?: QueryClient): TCombinedResult;
export { type QueriesOptions, type QueriesResults, useQueries };

@@ -58,6 +58,7 @@ "use client";

);
const shouldSubscribe = !isRestoring && options.subscribed !== false;
React.useSyncExternalStore(
React.useCallback(
(onStoreChange) => isRestoring ? noop : observer.subscribe(notifyManager.batchCalls(onStoreChange)),
[observer, isRestoring]
(onStoreChange) => shouldSubscribe ? observer.subscribe(notifyManager.batchCalls(onStoreChange)) : noop,
[observer, shouldSubscribe]
),

@@ -64,0 +65,0 @@ () => observer.getCurrentResult(),

@@ -5,2 +5,7 @@ import { DefaultError, QueryKey, QueryObserverOptions, OmitKeyof, SkipToken, InfiniteQueryObserverOptions, QueryObserverResult, DefinedQueryObserverResult, InfiniteQueryObserverResult, DefinedInfiniteQueryObserverResult, MutationObserverOptions, MutateFunction, Override, MutationObserverResult } from '@tanstack/query-core';

interface UseBaseQueryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> extends QueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey> {
/**
* Set this to `false` to unsubscribe this observer from updates to the query cache.
* Defaults to `true`.
*/
subscribed?: boolean;
}

@@ -7,0 +12,0 @@ type AnyUseQueryOptions = UseQueryOptions<any, any, any, any>;

@@ -48,10 +48,11 @@ "use client";

const result = observer.getOptimisticResult(defaultedOptions);
const shouldSubscribe = !isRestoring && options.subscribed !== false;
React.useSyncExternalStore(
React.useCallback(
(onStoreChange) => {
const unsubscribe = isRestoring ? noop : observer.subscribe(notifyManager.batchCalls(onStoreChange));
const unsubscribe = shouldSubscribe ? observer.subscribe(notifyManager.batchCalls(onStoreChange)) : noop;
observer.updateResult();
return unsubscribe;
},
[observer, isRestoring]
[observer, shouldSubscribe]
),

@@ -58,0 +59,0 @@ () => observer.getCurrentResult(),

import { UseQueryResult, UseQueryOptions, DefinedUseQueryResult } from './types.js';
import { DefaultError, QueryClient, QueryKey, OmitKeyof, QueriesPlaceholderDataFunction, QueryFunction, ThrowOnError } from '@tanstack/query-core';
type UseQueryOptionsForUseQueries<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> = OmitKeyof<UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>, 'placeholderData'> & {
type UseQueryOptionsForUseQueries<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> = OmitKeyof<UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>, 'placeholderData' | 'subscribed'> & {
placeholderData?: TQueryFnData | QueriesPlaceholderDataFunction<TQueryFnData>;

@@ -69,4 +69,5 @@ };

combine?: (result: QueriesResults<T>) => TCombinedResult;
subscribed?: boolean;
}, queryClient?: QueryClient): TCombinedResult;
export { type QueriesOptions, type QueriesResults, useQueries };

@@ -58,6 +58,7 @@ "use client";

);
const shouldSubscribe = !isRestoring && options.subscribed !== false;
React.useSyncExternalStore(
React.useCallback(
(onStoreChange) => isRestoring ? noop : observer.subscribe(notifyManager.batchCalls(onStoreChange)),
[observer, isRestoring]
(onStoreChange) => shouldSubscribe ? observer.subscribe(notifyManager.batchCalls(onStoreChange)) : noop,
[observer, shouldSubscribe]
),

@@ -64,0 +65,0 @@ () => observer.getCurrentResult(),

{
"name": "@tanstack/react-query",
"version": "5.62.16",
"version": "5.63.0",
"description": "Hooks for managing, caching and syncing asynchronous and remote data in React",

@@ -5,0 +5,0 @@ "author": "tannerlinsley",

@@ -39,3 +39,9 @@ /* istanbul ignore file */

TQueryKey
> {}
> {
/**
* Set this to `false` to unsubscribe this observer from updates to the query cache.
* Defaults to `true`.
*/
subscribed?: boolean
}

@@ -42,0 +48,0 @@ export type AnyUseQueryOptions = UseQueryOptions<any, any, any, any>

@@ -85,10 +85,12 @@ 'use client'

// note: this must be called before useSyncExternalStore
const result = observer.getOptimisticResult(defaultedOptions)
const shouldSubscribe = !isRestoring && options.subscribed !== false
React.useSyncExternalStore(
React.useCallback(
(onStoreChange) => {
const unsubscribe = isRestoring
? noop
: observer.subscribe(notifyManager.batchCalls(onStoreChange))
const unsubscribe = shouldSubscribe
? observer.subscribe(notifyManager.batchCalls(onStoreChange))
: noop

@@ -101,3 +103,3 @@ // Update result to make sure we did not miss any query updates

},
[observer, isRestoring],
[observer, shouldSubscribe],
),

@@ -104,0 +106,0 @@ () => observer.getCurrentResult(),

@@ -50,3 +50,3 @@ 'use client'

UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>,
'placeholderData'
'placeholderData' | 'subscribed'
> & {

@@ -235,2 +235,3 @@ placeholderData?: TQueryFnData | QueriesPlaceholderDataFunction<TQueryFnData>

combine?: (result: QueriesResults<T>) => TCombinedResult
subscribed?: boolean
},

@@ -276,2 +277,3 @@ queryClient?: QueryClient,

// note: this must be called before useSyncExternalStore
const [optimisticResult, getCombinedResult, trackResult] =

@@ -283,9 +285,10 @@ observer.getOptimisticResult(

const shouldSubscribe = !isRestoring && options.subscribed !== false
React.useSyncExternalStore(
React.useCallback(
(onStoreChange) =>
isRestoring
? noop
: observer.subscribe(notifyManager.batchCalls(onStoreChange)),
[observer, isRestoring],
shouldSubscribe
? observer.subscribe(notifyManager.batchCalls(onStoreChange))
: noop,
[observer, shouldSubscribe],
),

@@ -292,0 +295,0 @@ () => observer.getCurrentResult(),

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

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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc