@tempots/dom 31.2.0 → 31.4.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/README.md +22 -0
- package/index.cjs +1 -1
- package/index.js +349 -322
- package/package.json +1 -1
- package/std/signal-utils.d.ts +9 -1
package/package.json
CHANGED
package/std/signal-utils.d.ts
CHANGED
|
@@ -75,6 +75,10 @@ export type StoredPropOptions<T> = {
|
|
|
75
75
|
* The default implementation returns the value as is.
|
|
76
76
|
*/
|
|
77
77
|
onLoad?: (value: T) => T;
|
|
78
|
+
/**
|
|
79
|
+
* Whether to sync the value across tabs. Defaults to `true`.
|
|
80
|
+
*/
|
|
81
|
+
syncTabs?: boolean;
|
|
78
82
|
};
|
|
79
83
|
/**
|
|
80
84
|
* Creates a stored property that persists its value in a storage mechanism.
|
|
@@ -84,7 +88,7 @@ export type StoredPropOptions<T> = {
|
|
|
84
88
|
* @returns - The created stored property.
|
|
85
89
|
* @public
|
|
86
90
|
*/
|
|
87
|
-
export declare const storedProp: <T>({ key, defaultValue, store, serialize, deserialize, equals, onLoad, }: StoredPropOptions<T>) => Prop<T>;
|
|
91
|
+
export declare const storedProp: <T>({ key, defaultValue, store, serialize, deserialize, equals, onLoad, syncTabs, }: StoredPropOptions<T>) => Prop<T>;
|
|
88
92
|
/**
|
|
89
93
|
* Represents the properties required for storing and retrieving a value of type `T`.
|
|
90
94
|
*
|
|
@@ -122,6 +126,10 @@ export type StorageOptions<T> = {
|
|
|
122
126
|
* The default implementation returns the value as is.
|
|
123
127
|
*/
|
|
124
128
|
onLoad?: (value: T) => T;
|
|
129
|
+
/**
|
|
130
|
+
* Whether to sync the value across tabs. Defaults to `true`.
|
|
131
|
+
*/
|
|
132
|
+
syncTabs?: boolean;
|
|
125
133
|
};
|
|
126
134
|
/**
|
|
127
135
|
* Creates a prop that is backed by the localStorage or a MemoryStore.
|