@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/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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@asaidimu/react-store",
3
- "version": "1.4.11",
3
+ "version": "1.5.0",
4
4
  "description": "Efficient react state manager.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",