@hyper-fetch/core 5.4.1 → 5.5.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.
package/dist/index.cjs.js CHANGED
@@ -2380,22 +2380,42 @@ var Client = class {
2380
2380
  this.__onAuthCallbacks.push(callback);
2381
2381
  return this;
2382
2382
  };
2383
+ this.removeOnAuthInterceptors = (callbacks) => {
2384
+ this.__onAuthCallbacks = this.__onAuthCallbacks.filter((callback) => !callbacks.includes(callback));
2385
+ return this;
2386
+ };
2383
2387
  this.onError = (callback) => {
2384
2388
  this.__onErrorCallbacks.push(callback);
2385
2389
  return this;
2386
2390
  };
2391
+ this.removeOnErrorInterceptors = (callbacks) => {
2392
+ this.__onErrorCallbacks = this.__onErrorCallbacks.filter((callback) => !callbacks.includes(callback));
2393
+ return this;
2394
+ };
2387
2395
  this.onSuccess = (callback) => {
2388
2396
  this.__onSuccessCallbacks.push(callback);
2389
2397
  return this;
2390
2398
  };
2399
+ this.removeOnSuccessInterceptors = (callbacks) => {
2400
+ this.__onSuccessCallbacks = this.__onSuccessCallbacks.filter((callback) => !callbacks.includes(callback));
2401
+ return this;
2402
+ };
2391
2403
  this.onRequest = (callback) => {
2392
2404
  this.__onRequestCallbacks.push(callback);
2393
2405
  return this;
2394
2406
  };
2407
+ this.removeOnRequestInterceptors = (callbacks) => {
2408
+ this.__onRequestCallbacks = this.__onRequestCallbacks.filter((callback) => !callbacks.includes(callback));
2409
+ return this;
2410
+ };
2395
2411
  this.onResponse = (callback) => {
2396
2412
  this.__onResponseCallbacks.push(callback);
2397
2413
  return this;
2398
2414
  };
2415
+ this.removeOnResponseInterceptors = (callbacks) => {
2416
+ this.__onResponseCallbacks = this.__onResponseCallbacks.filter((callback) => !callbacks.includes(callback));
2417
+ return this;
2418
+ };
2399
2419
  this.addEffect = (effect) => {
2400
2420
  this.effects = this.effects.concat(effect);
2401
2421
  return this;