@tanstack/react-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.
@@ -1173,18 +1173,26 @@
1173
1173
 
1174
1174
  class Mutation extends Removable {
1175
1175
  #observers;
1176
+ #defaultOptions;
1176
1177
  #mutationCache;
1177
1178
  #retryer;
1178
1179
  constructor(config) {
1179
1180
  super();
1180
- this.options = config.options;
1181
1181
  this.mutationId = config.mutationId;
1182
+ this.#defaultOptions = config.defaultOptions;
1182
1183
  this.#mutationCache = config.mutationCache;
1183
1184
  this.#observers = [];
1184
1185
  this.state = config.state || getDefaultState();
1185
- this.updateGcTime(this.options.gcTime);
1186
+ this.setOptions(config.options);
1186
1187
  this.scheduleGc();
1187
1188
  }
1189
+ setOptions(options) {
1190
+ this.options = {
1191
+ ...this.#defaultOptions,
1192
+ ...options
1193
+ };
1194
+ this.updateGcTime(this.options.gcTime);
1195
+ }
1188
1196
  get meta() {
1189
1197
  return this.options.meta;
1190
1198
  }
@@ -2512,6 +2520,7 @@
2512
2520
  observer: this
2513
2521
  });
2514
2522
  }
2523
+ this.#currentMutation?.setOptions(this.options);
2515
2524
  }
2516
2525
  onUnsubscribe() {
2517
2526
  if (!this.listeners.length) {