@yiin/reactive-proxy-state 1.0.28 → 1.0.30
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 +2549 -69
- package/dist/index.js +2552 -69
- package/dist/integrations/vue3.d.ts +5 -1
- package/dist/utils.d.ts +6 -0
- package/package.json +1 -1
|
@@ -6,6 +6,10 @@ export type TrackVueReactiveEventsOptions = {
|
|
|
6
6
|
* Observe a Vue 3 reactive object and emit RPS-compatible StateEvents
|
|
7
7
|
* for each mutation performed through Vue reactivity.
|
|
8
8
|
*
|
|
9
|
-
*
|
|
9
|
+
* Uses per-key watchEffect partitioning: one effect per root key so that
|
|
10
|
+
* only the affected subtree is diffed on mutation. A root structural effect
|
|
11
|
+
* tracks Object.keys() for key add/delete at the top level.
|
|
12
|
+
*
|
|
13
|
+
* Returns a stop() function to tear down all effects.
|
|
10
14
|
*/
|
|
11
15
|
export declare function trackVueReactiveEvents<T extends object>(vueState: T, emit: (event: StateEvent) => void, options?: TrackVueReactiveEventsOptions): () => void;
|
package/dist/utils.d.ts
CHANGED
|
@@ -5,6 +5,12 @@ export declare const wrapperCache: WeakMap<object, object>;
|
|
|
5
5
|
export declare function deepEqual(a: any, b: any, seen?: WeakMap<any, any>): boolean;
|
|
6
6
|
export declare function getFromPathCache(root: object, pathKey: string): any | undefined;
|
|
7
7
|
export declare function setInPathCache(root: object, pathKey: string, value: any): void;
|
|
8
|
+
/**
|
|
9
|
+
* Evict all cached paths that are descendants of the given path prefix.
|
|
10
|
+
* Called when a value at `pathKey` is replaced so that deeper cached references
|
|
11
|
+
* (which now point to the old, detached object) are not reused.
|
|
12
|
+
*/
|
|
13
|
+
export declare function evictDescendantsFromPathCache(root: object, pathKey: string): void;
|
|
8
14
|
export declare function getPathConcat(path: string): any[] | undefined;
|
|
9
15
|
export declare function setPathConcat(path: string, value: any[]): void;
|
|
10
16
|
/**
|