@absolutejs/absolute 0.19.0-beta.962 → 0.19.0-beta.963
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/angular/browser.js +11 -2
- package/dist/angular/browser.js.map +4 -4
- package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/angular/index.js +11 -2
- package/dist/angular/index.js.map +4 -4
- package/dist/src/angular/browser.d.ts +1 -1
- package/dist/src/angular/composables/index.d.ts +1 -1
- package/dist/src/angular/composables/useResource.d.ts +6 -0
- package/dist/src/angular/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ export { ABSOLUTE_HTTP_TRANSFER_CACHE_SKIP_HEADER, buildAbsoluteHttpTransferCach
|
|
|
3
3
|
export { createDeterministicRandom, DETERMINISTIC_NOW, DETERMINISTIC_RANDOM, DETERMINISTIC_SEED, provideDeterministicEnv } from './deterministicEnv';
|
|
4
4
|
export { defineAngularPage } from './page';
|
|
5
5
|
export { useResource, useSubscription, useTimers } from './composables';
|
|
6
|
-
export type { Observer, Resource, ResourceFetcher, ResourceOptions } from './composables';
|
|
6
|
+
export type { Observer, Resource, ResourceFetcher, ResourceMutator, ResourceOptions } from './composables';
|
|
7
7
|
export { preserveAcrossHmr } from './preserveAcrossHmr';
|
|
8
8
|
export { Island } from './Island.browser';
|
|
9
9
|
export { withPendingTask } from './pendingTask';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { useResource } from './useResource';
|
|
2
|
-
export type { Resource, ResourceFetcher, ResourceOptions } from './useResource';
|
|
2
|
+
export type { Resource, ResourceFetcher, ResourceMutator, ResourceOptions } from './useResource';
|
|
3
3
|
export { useSubscription } from './useSubscription';
|
|
4
4
|
export type { Observer } from './useSubscription';
|
|
5
5
|
export { useTimers } from './useTimers';
|
|
@@ -5,6 +5,7 @@ export type ResourceOptions = {
|
|
|
5
5
|
* `false` to defer the first load until `refresh()` is called. */
|
|
6
6
|
immediate?: boolean;
|
|
7
7
|
};
|
|
8
|
+
export type ResourceMutator<T> = T | null | ((prev: T | null) => T | null);
|
|
8
9
|
export type Resource<T> = {
|
|
9
10
|
/** Latest resolved value, or `null` before the first successful load. */
|
|
10
11
|
data: Signal<T | null>;
|
|
@@ -16,6 +17,11 @@ export type Resource<T> = {
|
|
|
16
17
|
refresh: () => Promise<void>;
|
|
17
18
|
/** Aborts the in-flight request, if any. No-op otherwise. */
|
|
18
19
|
cancel: () => void;
|
|
20
|
+
/** Imperatively write the data signal without re-fetching. Accepts a
|
|
21
|
+
* new value or an updater function. Use after an edit action returns
|
|
22
|
+
* the new entity, so you avoid a wasteful re-fetch. Pending fetches
|
|
23
|
+
* are aborted so a slower response can't clobber the mutation. */
|
|
24
|
+
mutate: (next: ResourceMutator<T>) => void;
|
|
19
25
|
};
|
|
20
26
|
/** Signal-backed async data composable. Replaces the React
|
|
21
27
|
* `useEffect(() => { fetch(); }, [])` + `useState` pair with a single
|
|
@@ -5,7 +5,7 @@ export { createDeterministicRandom, DETERMINISTIC_NOW, DETERMINISTIC_RANDOM, DET
|
|
|
5
5
|
export { handleAngularPageRequest } from './pageHandler';
|
|
6
6
|
export { defineAngularPage } from './page';
|
|
7
7
|
export { useResource, useSubscription, useTimers } from './composables';
|
|
8
|
-
export type { Observer, Resource, ResourceFetcher, ResourceOptions } from './composables';
|
|
8
|
+
export type { Observer, Resource, ResourceFetcher, ResourceMutator, ResourceOptions } from './composables';
|
|
9
9
|
export { preserveAcrossHmr } from './preserveAcrossHmr';
|
|
10
10
|
export { withPendingTask } from './pendingTask';
|
|
11
11
|
export { createTypedIsland } from './createIsland';
|
package/package.json
CHANGED