@absolutejs/absolute 0.19.0-beta.962 → 0.19.0-beta.964

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.
@@ -9397,9 +9397,10 @@ var defineAngularPage = (definition) => definition;
9397
9397
  import { DestroyRef, inject, signal } from "@angular/core";
9398
9398
  var useResource = (fetcher, options = {}) => {
9399
9399
  const destroyRef = inject(DestroyRef);
9400
+ const start = options.start ?? "immediate";
9400
9401
  const data = signal(null);
9401
9402
  const error = signal(null);
9402
- const loading = signal(false);
9403
+ const loading = signal(start !== "idle");
9403
9404
  let controller = null;
9404
9405
  let destroyed = false;
9405
9406
  const cancel = () => {
@@ -9434,14 +9435,23 @@ var useResource = (fetcher, options = {}) => {
9434
9435
  }
9435
9436
  }
9436
9437
  };
9438
+ const mutate = (next) => {
9439
+ if (destroyed)
9440
+ return;
9441
+ cancel();
9442
+ error.set(null);
9443
+ loading.set(false);
9444
+ const resolved = typeof next === "function" ? next(data()) : next;
9445
+ data.set(resolved);
9446
+ };
9437
9447
  destroyRef.onDestroy(() => {
9438
9448
  destroyed = true;
9439
9449
  cancel();
9440
9450
  });
9441
- if (options.immediate !== false) {
9451
+ if (start === "immediate") {
9442
9452
  refresh();
9443
9453
  }
9444
- return { cancel, data, error, loading, refresh };
9454
+ return { cancel, data, error, loading, mutate, refresh };
9445
9455
  };
9446
9456
  // src/angular/composables/useSubscription.ts
9447
9457
  import { DestroyRef as DestroyRef2, inject as inject2 } from "@angular/core";
@@ -10344,5 +10354,5 @@ export {
10344
10354
  ABSOLUTE_HTTP_TRANSFER_CACHE_SKIP_HEADER
10345
10355
  };
10346
10356
 
10347
- //# debugId=FD9C5AD1A03DDE0F64756E2164756E21
10357
+ //# debugId=BB32210B0FAF825464756E2164756E21
10348
10358
  //# sourceMappingURL=browser.js.map