New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@tanstack/vue-query

Package Overview
Dependencies
Maintainers
0
Versions
325
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tanstack/vue-query - npm Package Compare versions

Comparing version 5.62.12 to 5.62.16

60

build/legacy/useQueries.js

@@ -44,7 +44,23 @@ // src/useQueries.ts

);
const [, getCombinedResult] = observer.getOptimisticResult(
defaultedQueries.value,
options.combine
);
const state = shallowRef(getCombinedResult());
const getOptimisticResult = () => {
const [results, getCombinedResult] = observer.getOptimisticResult(
defaultedQueries.value,
options.combine
);
return getCombinedResult(
results.map((result, index) => {
return {
...result,
refetch: async (...args) => {
const [{ [index]: query }] = observer.getOptimisticResult(
defaultedQueries.value,
options.combine
);
return query.refetch(...args);
}
};
})
);
};
const state = shallowRef(getOptimisticResult());
let unsubscribe = () => {

@@ -58,13 +74,5 @@ };

unsubscribe = observer.subscribe(() => {
const [, getCombinedResultRestoring] = observer.getOptimisticResult(
defaultedQueries.value,
options.combine
);
state.value = getCombinedResultRestoring();
state.value = getOptimisticResult();
});
const [, getCombinedResultPersisted] = observer.getOptimisticResult(
defaultedQueries.value,
options.combine
);
state.value = getCombinedResultPersisted();
state.value = getOptimisticResult();
}

@@ -74,17 +82,9 @@ },

);
watch(
defaultedQueries,
() => {
observer.setQueries(
defaultedQueries.value,
options
);
const [, getCombinedResultPersisted] = observer.getOptimisticResult(
defaultedQueries.value,
options.combine
);
state.value = getCombinedResultPersisted();
},
{ flush: "sync" }
);
watch(defaultedQueries, (queriesValue) => {
observer.setQueries(
queriesValue,
options
);
state.value = getOptimisticResult();
});
onScopeDispose(() => {

@@ -91,0 +91,0 @@ unsubscribe();

@@ -44,7 +44,23 @@ // src/useQueries.ts

);
const [, getCombinedResult] = observer.getOptimisticResult(
defaultedQueries.value,
options.combine
);
const state = shallowRef(getCombinedResult());
const getOptimisticResult = () => {
const [results, getCombinedResult] = observer.getOptimisticResult(
defaultedQueries.value,
options.combine
);
return getCombinedResult(
results.map((result, index) => {
return {
...result,
refetch: async (...args) => {
const [{ [index]: query }] = observer.getOptimisticResult(
defaultedQueries.value,
options.combine
);
return query.refetch(...args);
}
};
})
);
};
const state = shallowRef(getOptimisticResult());
let unsubscribe = () => {

@@ -58,13 +74,5 @@ };

unsubscribe = observer.subscribe(() => {
const [, getCombinedResultRestoring] = observer.getOptimisticResult(
defaultedQueries.value,
options.combine
);
state.value = getCombinedResultRestoring();
state.value = getOptimisticResult();
});
const [, getCombinedResultPersisted] = observer.getOptimisticResult(
defaultedQueries.value,
options.combine
);
state.value = getCombinedResultPersisted();
state.value = getOptimisticResult();
}

@@ -74,17 +82,9 @@ },

);
watch(
defaultedQueries,
() => {
observer.setQueries(
defaultedQueries.value,
options
);
const [, getCombinedResultPersisted] = observer.getOptimisticResult(
defaultedQueries.value,
options.combine
);
state.value = getCombinedResultPersisted();
},
{ flush: "sync" }
);
watch(defaultedQueries, (queriesValue) => {
observer.setQueries(
queriesValue,
options
);
state.value = getOptimisticResult();
});
onScopeDispose(() => {

@@ -91,0 +91,0 @@ unsubscribe();

{
"name": "@tanstack/vue-query",
"version": "5.62.12",
"version": "5.62.16",
"description": "Hooks for managing, caching and syncing asynchronous and remote data in Vue",

@@ -53,3 +53,3 @@ "author": "Damian Osipiuk",

"vue-demi": "^0.14.10",
"@tanstack/query-core": "5.62.12"
"@tanstack/query-core": "5.62.16"
},

@@ -56,0 +56,0 @@ "devDependencies": {

@@ -300,8 +300,28 @@ import { QueriesObserver } from '@tanstack/query-core'

)
const [, getCombinedResult] = observer.getOptimisticResult(
defaultedQueries.value,
(options as QueriesObserverOptions<TCombinedResult>).combine,
)
const state = shallowRef(getCombinedResult())
const getOptimisticResult = () => {
const [results, getCombinedResult] = observer.getOptimisticResult(
defaultedQueries.value,
(options as QueriesObserverOptions<TCombinedResult>).combine,
)
return getCombinedResult(
results.map((result, index) => {
return {
...result,
refetch: async (...args: Array<any>) => {
const [{ [index]: query }] = observer.getOptimisticResult(
defaultedQueries.value,
(options as QueriesObserverOptions<TCombinedResult>).combine,
)
return query!.refetch(...args)
},
}
}),
)
}
const state = shallowRef(getOptimisticResult())
let unsubscribe = () => {

@@ -317,14 +337,6 @@ // noop

unsubscribe = observer.subscribe(() => {
const [, getCombinedResultRestoring] = observer.getOptimisticResult(
defaultedQueries.value,
(options as QueriesObserverOptions<TCombinedResult>).combine,
)
state.value = getCombinedResultRestoring()
state.value = getOptimisticResult()
})
// Subscription would not fire for persisted results
const [, getCombinedResultPersisted] = observer.getOptimisticResult(
defaultedQueries.value,
(options as QueriesObserverOptions<TCombinedResult>).combine,
)
state.value = getCombinedResultPersisted()
state.value = getOptimisticResult()
}

@@ -335,17 +347,9 @@ },

watch(
defaultedQueries,
() => {
observer.setQueries(
defaultedQueries.value,
options as QueriesObserverOptions<TCombinedResult>,
)
const [, getCombinedResultPersisted] = observer.getOptimisticResult(
defaultedQueries.value,
(options as QueriesObserverOptions<TCombinedResult>).combine,
)
state.value = getCombinedResultPersisted()
},
{ flush: 'sync' },
)
watch(defaultedQueries, (queriesValue) => {
observer.setQueries(
queriesValue,
options as QueriesObserverOptions<TCombinedResult>,
)
state.value = getOptimisticResult()
})

@@ -352,0 +356,0 @@ onScopeDispose(() => {

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