@tanstack/vue-query 5.0.0-alpha.2 → 5.0.0-alpha.3
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.
|
@@ -1154,18 +1154,26 @@
|
|
|
1154
1154
|
|
|
1155
1155
|
class Mutation extends Removable {
|
|
1156
1156
|
#observers;
|
|
1157
|
+
#defaultOptions;
|
|
1157
1158
|
#mutationCache;
|
|
1158
1159
|
#retryer;
|
|
1159
1160
|
constructor(config) {
|
|
1160
1161
|
super();
|
|
1161
|
-
this.options = config.options;
|
|
1162
1162
|
this.mutationId = config.mutationId;
|
|
1163
|
+
this.#defaultOptions = config.defaultOptions;
|
|
1163
1164
|
this.#mutationCache = config.mutationCache;
|
|
1164
1165
|
this.#observers = [];
|
|
1165
1166
|
this.state = config.state || getDefaultState();
|
|
1166
|
-
this.
|
|
1167
|
+
this.setOptions(config.options);
|
|
1167
1168
|
this.scheduleGc();
|
|
1168
1169
|
}
|
|
1170
|
+
setOptions(options) {
|
|
1171
|
+
this.options = {
|
|
1172
|
+
...this.#defaultOptions,
|
|
1173
|
+
...options
|
|
1174
|
+
};
|
|
1175
|
+
this.updateGcTime(this.options.gcTime);
|
|
1176
|
+
}
|
|
1169
1177
|
get meta() {
|
|
1170
1178
|
return this.options.meta;
|
|
1171
1179
|
}
|
|
@@ -2493,6 +2501,7 @@
|
|
|
2493
2501
|
observer: this
|
|
2494
2502
|
});
|
|
2495
2503
|
}
|
|
2504
|
+
this.#currentMutation?.setOptions(this.options);
|
|
2496
2505
|
}
|
|
2497
2506
|
onUnsubscribe() {
|
|
2498
2507
|
if (!this.listeners.length) {
|