@telperion/reactive-storage 1.2.0 → 1.3.1
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/.build-manifest.json +86 -0
- package/README.md +6 -6
- package/fesm/reactive-storage.mjs +639 -0
- package/fesm/reactive-storage.mjs.map +1 -0
- package/index.cjs +17 -8
- package/index.cjs.map +1 -0
- package/index.d.cts +6 -0
- package/index.d.ts +6 -5
- package/index.js +5 -6
- package/index.js.map +1 -1
- package/json-parse.cjs +5 -3
- package/json-parse.cjs.map +1 -0
- package/json-parse.d.cts +8 -0
- package/json-parse.d.ts +3 -1
- package/json-parse.js +2 -1
- package/json-parse.js.map +1 -1
- package/package.json +60 -31
- package/reactive-cookie-storage.cjs +69 -50
- package/reactive-cookie-storage.cjs.map +1 -0
- package/reactive-cookie-storage.d.cts +77 -0
- package/reactive-cookie-storage.d.ts +48 -40
- package/reactive-cookie-storage.js +60 -41
- package/reactive-cookie-storage.js.map +1 -1
- package/reactive-storage.cjs +168 -83
- package/reactive-storage.cjs.map +1 -0
- package/reactive-storage.d.cts +165 -0
- package/reactive-storage.d.ts +118 -37
- package/reactive-storage.js +128 -43
- package/reactive-storage.js.map +1 -1
- package/reactive-web-local-storage.cjs +30 -8
- package/reactive-web-local-storage.cjs.map +1 -0
- package/reactive-web-local-storage.d.cts +37 -0
- package/reactive-web-local-storage.d.ts +30 -5
- package/reactive-web-local-storage.js +27 -5
- package/reactive-web-local-storage.js.map +1 -1
- package/reactive-web-session-storage.cjs +24 -8
- package/reactive-web-session-storage.cjs.map +1 -0
- package/reactive-web-session-storage.d.cts +31 -0
- package/reactive-web-session-storage.d.ts +24 -5
- package/reactive-web-session-storage.js +21 -5
- package/reactive-web-session-storage.js.map +1 -1
- package/reactive-web-storage.cjs +42 -27
- package/reactive-web-storage.cjs.map +1 -0
- package/reactive-web-storage.d.cts +47 -0
- package/reactive-web-storage.d.ts +28 -10
- package/reactive-web-storage.js +33 -18
- package/reactive-web-storage.js.map +1 -1
- package/async-iterator.polyfill.cjs +0 -87
- package/async-iterator.polyfill.d.ts +0 -2
- package/async-iterator.polyfill.js +0 -86
- package/async-iterator.polyfill.js.map +0 -1
- package/regex-parser.cjs +0 -29
- package/regex-parser.d.ts +0 -11
- package/regex-parser.js +0 -27
- package/regex-parser.js.map +0 -1
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"name": "reactive-storage",
|
|
4
|
+
"version": "0.0.0",
|
|
5
|
+
"formats": [
|
|
6
|
+
"esm",
|
|
7
|
+
"esmFlat",
|
|
8
|
+
"cjs",
|
|
9
|
+
"dts",
|
|
10
|
+
"dcts"
|
|
11
|
+
],
|
|
12
|
+
"entries": [
|
|
13
|
+
{
|
|
14
|
+
"name": "index",
|
|
15
|
+
"sourcePath": "src/index.ts",
|
|
16
|
+
"outputs": {
|
|
17
|
+
"esm": "index.js",
|
|
18
|
+
"esmFlat": "fesm/reactive-storage.mjs",
|
|
19
|
+
"cjs": "index.cjs",
|
|
20
|
+
"dts": "index.d.ts",
|
|
21
|
+
"dcts": "index.d.cts"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"name": "json-parse",
|
|
26
|
+
"sourcePath": "src/json-parse.ts",
|
|
27
|
+
"outputs": {
|
|
28
|
+
"esm": "json-parse.js",
|
|
29
|
+
"cjs": "json-parse.cjs",
|
|
30
|
+
"dts": "json-parse.d.ts",
|
|
31
|
+
"dcts": "json-parse.d.cts"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"name": "reactive-cookie-storage",
|
|
36
|
+
"sourcePath": "src/reactive-cookie-storage.ts",
|
|
37
|
+
"outputs": {
|
|
38
|
+
"esm": "reactive-cookie-storage.js",
|
|
39
|
+
"cjs": "reactive-cookie-storage.cjs",
|
|
40
|
+
"dts": "reactive-cookie-storage.d.ts",
|
|
41
|
+
"dcts": "reactive-cookie-storage.d.cts"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"name": "reactive-storage",
|
|
46
|
+
"sourcePath": "src/reactive-storage.ts",
|
|
47
|
+
"outputs": {
|
|
48
|
+
"esm": "reactive-storage.js",
|
|
49
|
+
"cjs": "reactive-storage.cjs",
|
|
50
|
+
"dts": "reactive-storage.d.ts",
|
|
51
|
+
"dcts": "reactive-storage.d.cts"
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"name": "reactive-web-local-storage",
|
|
56
|
+
"sourcePath": "src/reactive-web-local-storage.ts",
|
|
57
|
+
"outputs": {
|
|
58
|
+
"esm": "reactive-web-local-storage.js",
|
|
59
|
+
"cjs": "reactive-web-local-storage.cjs",
|
|
60
|
+
"dts": "reactive-web-local-storage.d.ts",
|
|
61
|
+
"dcts": "reactive-web-local-storage.d.cts"
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"name": "reactive-web-session-storage",
|
|
66
|
+
"sourcePath": "src/reactive-web-session-storage.ts",
|
|
67
|
+
"outputs": {
|
|
68
|
+
"esm": "reactive-web-session-storage.js",
|
|
69
|
+
"cjs": "reactive-web-session-storage.cjs",
|
|
70
|
+
"dts": "reactive-web-session-storage.d.ts",
|
|
71
|
+
"dcts": "reactive-web-session-storage.d.cts"
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"name": "reactive-web-storage",
|
|
76
|
+
"sourcePath": "src/reactive-web-storage.ts",
|
|
77
|
+
"outputs": {
|
|
78
|
+
"esm": "reactive-web-storage.js",
|
|
79
|
+
"cjs": "reactive-web-storage.cjs",
|
|
80
|
+
"dts": "reactive-web-storage.d.ts",
|
|
81
|
+
"dcts": "reactive-web-storage.d.cts"
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
],
|
|
85
|
+
"generatedAt": "2026-11-19T13:52:07.439Z"
|
|
86
|
+
}
|
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
[](https://badge.fury.io/js/%40telperion%2Freactive-storage)
|
|
4
4
|
[](https://opensource.org/licenses/MIT)
|
|
5
5
|
|
|
6
|
-
Reactive RxJS-based wrapper for browser storage APIs (localStorage and sessionStorage). Provides an Observable-based API for real-time storage updates with support for nested property access
|
|
6
|
+
Reactive RxJS-based wrapper for browser storage APIs (localStorage and sessionStorage). Provides an Observable-based API for real-time storage updates with support for nested property access. Changes made through an instance (or, for cookies, through linked instances) reach all of its subscribers.
|
|
7
7
|
|
|
8
8
|
## Features
|
|
9
9
|
|
|
@@ -100,12 +100,12 @@ const storage = new ReactiveCookieStorage(
|
|
|
100
100
|
- `options` (optional): Cookie configuration options
|
|
101
101
|
|
|
102
102
|
**Options:**
|
|
103
|
-
- `path` (string): URL path where cookie is valid. Default:
|
|
103
|
+
- `path` (string): URL path where cookie is valid. Default: not set (the browser uses the current page's path)
|
|
104
104
|
- `domain` (string): Domain where cookie is valid. Default: current domain
|
|
105
105
|
- `maxAge` (number): Cookie lifetime in seconds. Default: `undefined` (session cookie)
|
|
106
106
|
- `expires` (Date): Absolute expiration date. Default: `undefined`
|
|
107
107
|
- `secure` (boolean): HTTPS only flag. Default: `false`
|
|
108
|
-
- `sameSite` ('strict' | 'lax' | 'none'): CSRF protection level. Default: `
|
|
108
|
+
- `sameSite` ('strict' | 'lax' | 'none'): CSRF protection level. Default: not set (the browser default, `lax` in current browsers)
|
|
109
109
|
|
|
110
110
|
**Third Parameter (optional):**
|
|
111
111
|
- `linker` (any): Value to link multiple instances for cross-instance synchronization. Can be a Symbol, string, number, object, or any other value.
|
|
@@ -202,7 +202,7 @@ await storage.set('user', 'profile.name', undefined);
|
|
|
202
202
|
|
|
203
203
|
#### `patch(storeName: string, key: string, value: any): Promise<void>`
|
|
204
204
|
|
|
205
|
-
Merge
|
|
205
|
+
Merge the properties of an object into the object at a path, one level deep. `null` and `undefined` properties are skipped; when there is no object yet, the value starts a new one.
|
|
206
206
|
|
|
207
207
|
**Example:**
|
|
208
208
|
```typescript
|
|
@@ -240,7 +240,7 @@ await storage.push('todos', 'items', 'Task 2', 'Task 3');
|
|
|
240
240
|
|
|
241
241
|
#### `drop(storeName: string, key: string, value: any): Promise<void>`
|
|
242
242
|
|
|
243
|
-
Remove
|
|
243
|
+
Remove the first item of an array in storage that equals the value. Items are compared by content (as JSON), so objects match when they have the same properties and values.
|
|
244
244
|
|
|
245
245
|
**Example:**
|
|
246
246
|
```typescript
|
|
@@ -441,7 +441,7 @@ This library serves as the foundation for framework-specific integrations:
|
|
|
441
441
|
3. **Change Tracking**: Internal Subject emits changes that update all subscribers
|
|
442
442
|
4. **FIFO Queue**: Write operations are queued using `@FifoPromise` decorator to prevent race conditions
|
|
443
443
|
5. **Immutability**: All emitted values are deep-frozen to prevent accidental mutations
|
|
444
|
-
6. **
|
|
444
|
+
6. **Scope**: Only changes made through the same instance are observed; changes from other tabs or other instances are not
|
|
445
445
|
|
|
446
446
|
### Cookie Storage
|
|
447
447
|
|