@asaidimu/react-store 1.4.11 → 1.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/README.md +879 -256
- package/index.d.cts +5 -2
- package/index.d.ts +5 -2
- package/package.json +1 -1
package/index.d.cts
CHANGED
|
@@ -4,7 +4,9 @@
|
|
|
4
4
|
interface DataStorePersistence<T> {
|
|
5
5
|
/**
|
|
6
6
|
* Persists data to storage
|
|
7
|
-
* @param id The id of the consumer instance
|
|
7
|
+
* @param id The id of the consumer instance, not of the data/state being
|
|
8
|
+
* persisted. The consumer instance should implement some mechanism to
|
|
9
|
+
* identify itself. Best done with a uuid created at instantiation.
|
|
8
10
|
* @param state The state to persist
|
|
9
11
|
* @returns boolean indicating success or Promise resolving to success status
|
|
10
12
|
*/
|
|
@@ -15,7 +17,8 @@ interface DataStorePersistence<T> {
|
|
|
15
17
|
*/
|
|
16
18
|
get(): T | null | Promise<T | null>;
|
|
17
19
|
/**
|
|
18
|
-
* Subscribes to changes in persisted data (e.g., from other tabs)
|
|
20
|
+
* Subscribes to changes in persisted data (e.g., from other tabs/instances)
|
|
21
|
+
* if persistence is shared
|
|
19
22
|
* @param id The id of the consumer instance
|
|
20
23
|
* @param callback Function to call when persisted data changes
|
|
21
24
|
* @returns Function to unsubscribe
|
package/index.d.ts
CHANGED
|
@@ -4,7 +4,9 @@
|
|
|
4
4
|
interface DataStorePersistence<T> {
|
|
5
5
|
/**
|
|
6
6
|
* Persists data to storage
|
|
7
|
-
* @param id The id of the consumer instance
|
|
7
|
+
* @param id The id of the consumer instance, not of the data/state being
|
|
8
|
+
* persisted. The consumer instance should implement some mechanism to
|
|
9
|
+
* identify itself. Best done with a uuid created at instantiation.
|
|
8
10
|
* @param state The state to persist
|
|
9
11
|
* @returns boolean indicating success or Promise resolving to success status
|
|
10
12
|
*/
|
|
@@ -15,7 +17,8 @@ interface DataStorePersistence<T> {
|
|
|
15
17
|
*/
|
|
16
18
|
get(): T | null | Promise<T | null>;
|
|
17
19
|
/**
|
|
18
|
-
* Subscribes to changes in persisted data (e.g., from other tabs)
|
|
20
|
+
* Subscribes to changes in persisted data (e.g., from other tabs/instances)
|
|
21
|
+
* if persistence is shared
|
|
19
22
|
* @param id The id of the consumer instance
|
|
20
23
|
* @param callback Function to call when persisted data changes
|
|
21
24
|
* @returns Function to unsubscribe
|