@tanstack/react-query 4.24.10 → 4.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1105,10 +1105,11 @@
|
|
|
1105
1105
|
}
|
|
1106
1106
|
|
|
1107
1107
|
if (!isCancelledError(error)) {
|
|
1108
|
-
var _this$cache$config$on, _this$cache$config;
|
|
1108
|
+
var _this$cache$config$on, _this$cache$config, _this$cache$config$on2, _this$cache$config2;
|
|
1109
1109
|
|
|
1110
1110
|
// Notify cache callback
|
|
1111
1111
|
(_this$cache$config$on = (_this$cache$config = this.cache.config).onError) == null ? void 0 : _this$cache$config$on.call(_this$cache$config, error, this);
|
|
1112
|
+
(_this$cache$config$on2 = (_this$cache$config2 = this.cache.config).onSettled) == null ? void 0 : _this$cache$config$on2.call(_this$cache$config2, this.state.data, error, this);
|
|
1112
1113
|
|
|
1113
1114
|
{
|
|
1114
1115
|
this.logger.error(error);
|
|
@@ -1128,7 +1129,7 @@
|
|
|
1128
1129
|
fn: context.fetchFn,
|
|
1129
1130
|
abort: abortController == null ? void 0 : abortController.abort.bind(abortController),
|
|
1130
1131
|
onSuccess: data => {
|
|
1131
|
-
var _this$cache$config$
|
|
1132
|
+
var _this$cache$config$on3, _this$cache$config3, _this$cache$config$on4, _this$cache$config4;
|
|
1132
1133
|
|
|
1133
1134
|
if (typeof data === 'undefined') {
|
|
1134
1135
|
{
|
|
@@ -1141,7 +1142,8 @@
|
|
|
1141
1142
|
|
|
1142
1143
|
this.setData(data); // Notify cache callback
|
|
1143
1144
|
|
|
1144
|
-
(_this$cache$config$
|
|
1145
|
+
(_this$cache$config$on3 = (_this$cache$config3 = this.cache.config).onSuccess) == null ? void 0 : _this$cache$config$on3.call(_this$cache$config3, data, this);
|
|
1146
|
+
(_this$cache$config$on4 = (_this$cache$config4 = this.cache.config).onSettled) == null ? void 0 : _this$cache$config$on4.call(_this$cache$config4, data, this.state.error, this);
|
|
1145
1147
|
|
|
1146
1148
|
if (!this.isFetchingOptimistic) {
|
|
1147
1149
|
// Schedule query gc after fetching
|
|
@@ -1512,7 +1514,7 @@
|
|
|
1512
1514
|
const restored = this.state.status === 'loading';
|
|
1513
1515
|
|
|
1514
1516
|
try {
|
|
1515
|
-
var _this$mutationCache$c3, _this$mutationCache$c4, _this$options$onSucce, _this$options2, _this$options$onSettl, _this$options3;
|
|
1517
|
+
var _this$mutationCache$c3, _this$mutationCache$c4, _this$options$onSucce, _this$options2, _this$mutationCache$c5, _this$mutationCache$c6, _this$options$onSettl, _this$options3;
|
|
1516
1518
|
|
|
1517
1519
|
if (!restored) {
|
|
1518
1520
|
var _this$mutationCache$c, _this$mutationCache$c2, _this$options$onMutat, _this$options;
|
|
@@ -1537,7 +1539,9 @@
|
|
|
1537
1539
|
const data = await executeMutation(); // Notify cache callback
|
|
1538
1540
|
|
|
1539
1541
|
await ((_this$mutationCache$c3 = (_this$mutationCache$c4 = this.mutationCache.config).onSuccess) == null ? void 0 : _this$mutationCache$c3.call(_this$mutationCache$c4, data, this.state.variables, this.state.context, this));
|
|
1540
|
-
await ((_this$options$onSucce = (_this$options2 = this.options).onSuccess) == null ? void 0 : _this$options$onSucce.call(_this$options2, data, this.state.variables, this.state.context));
|
|
1542
|
+
await ((_this$options$onSucce = (_this$options2 = this.options).onSuccess) == null ? void 0 : _this$options$onSucce.call(_this$options2, data, this.state.variables, this.state.context)); // Notify cache callback
|
|
1543
|
+
|
|
1544
|
+
await ((_this$mutationCache$c5 = (_this$mutationCache$c6 = this.mutationCache.config).onSettled) == null ? void 0 : _this$mutationCache$c5.call(_this$mutationCache$c6, data, null, this.state.variables, this.state.context, this));
|
|
1541
1545
|
await ((_this$options$onSettl = (_this$options3 = this.options).onSettled) == null ? void 0 : _this$options$onSettl.call(_this$options3, data, null, this.state.variables, this.state.context));
|
|
1542
1546
|
this.dispatch({
|
|
1543
1547
|
type: 'success',
|
|
@@ -1546,16 +1550,18 @@
|
|
|
1546
1550
|
return data;
|
|
1547
1551
|
} catch (error) {
|
|
1548
1552
|
try {
|
|
1549
|
-
var _this$mutationCache$
|
|
1553
|
+
var _this$mutationCache$c7, _this$mutationCache$c8, _this$options$onError, _this$options4, _this$mutationCache$c9, _this$mutationCache$c10, _this$options$onSettl2, _this$options5;
|
|
1550
1554
|
|
|
1551
1555
|
// Notify cache callback
|
|
1552
|
-
await ((_this$mutationCache$
|
|
1556
|
+
await ((_this$mutationCache$c7 = (_this$mutationCache$c8 = this.mutationCache.config).onError) == null ? void 0 : _this$mutationCache$c7.call(_this$mutationCache$c8, error, this.state.variables, this.state.context, this));
|
|
1553
1557
|
|
|
1554
1558
|
if ("development" !== 'production') {
|
|
1555
1559
|
this.logger.error(error);
|
|
1556
1560
|
}
|
|
1557
1561
|
|
|
1558
|
-
await ((_this$options$onError = (_this$options4 = this.options).onError) == null ? void 0 : _this$options$onError.call(_this$options4, error, this.state.variables, this.state.context));
|
|
1562
|
+
await ((_this$options$onError = (_this$options4 = this.options).onError) == null ? void 0 : _this$options$onError.call(_this$options4, error, this.state.variables, this.state.context)); // Notify cache callback
|
|
1563
|
+
|
|
1564
|
+
await ((_this$mutationCache$c9 = (_this$mutationCache$c10 = this.mutationCache.config).onSettled) == null ? void 0 : _this$mutationCache$c9.call(_this$mutationCache$c10, undefined, error, this.state.variables, this.state.context, this));
|
|
1559
1565
|
await ((_this$options$onSettl2 = (_this$options5 = this.options).onSettled) == null ? void 0 : _this$options$onSettl2.call(_this$options5, undefined, error, this.state.variables, this.state.context));
|
|
1560
1566
|
throw error;
|
|
1561
1567
|
} finally {
|
|
@@ -3826,6 +3832,7 @@
|
|
|
3826
3832
|
exports.isCancelledError = isCancelledError;
|
|
3827
3833
|
exports.isError = isError;
|
|
3828
3834
|
exports.isServer = isServer;
|
|
3835
|
+
exports.matchQuery = matchQuery;
|
|
3829
3836
|
exports.notifyManager = notifyManager;
|
|
3830
3837
|
exports.onlineManager = onlineManager;
|
|
3831
3838
|
exports.parseFilterArgs = parseFilterArgs;
|