dphelper 1.8.90 → 1.8.92
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 +10 -12
- package/docs/index.md +10 -12
- package/documents/STORE.md +64 -64
- package/documents/TOOLS.md +569 -567
- package/index.js +1 -1
- package/package.json +2 -2
- package/types/dphelper.d.ts +1 -1
- package/types/state.d.ts +11 -0
- package/types/store.d.ts +4 -0
package/README.md
CHANGED
|
@@ -141,8 +141,6 @@ state.removeAll()
|
|
|
141
141
|
|
|
142
142
|
**Note**: _Observer works only with states. Stores are excluded at the moment._
|
|
143
143
|
|
|
144
|
-
🔥NEW🔥: Great, now you can use nested objects in observer. You need to declare "state." or "store." before selecting the object you want to monitor.
|
|
145
|
-
|
|
146
144
|
If you want to run a function every time a state changes, you can use:
|
|
147
145
|
|
|
148
146
|
```javascript
|
|
@@ -208,7 +206,7 @@ When using dpHelper for permanent storage, you should use the **store**, which s
|
|
|
208
206
|
|
|
209
207
|
2. **Remove data when necessary:** To maintain security, remove stored data when it is no longer needed, such as during logout.
|
|
210
208
|
|
|
211
|
-
3. **
|
|
209
|
+
3. **Remove all stored data:** Use store.removeAll() to securely remove all stored data from your application.
|
|
212
210
|
|
|
213
211
|
```javascript
|
|
214
212
|
// Set a store:
|
|
@@ -218,10 +216,10 @@ store.set("test", { test: "test" })
|
|
|
218
216
|
store.get("test") // Output: { test: "test" }
|
|
219
217
|
|
|
220
218
|
// Remove a store:
|
|
221
|
-
store.
|
|
219
|
+
store.remove("test") // Output: "ok"
|
|
222
220
|
|
|
223
221
|
// Remove all stores:
|
|
224
|
-
store.
|
|
222
|
+
store.removeAll() // Output: "ok"
|
|
225
223
|
```
|
|
226
224
|
|
|
227
225
|
### Example in React
|
|
@@ -249,8 +247,8 @@ function App() {
|
|
|
249
247
|
}, []
|
|
250
248
|
);
|
|
251
249
|
|
|
252
|
-
//
|
|
253
|
-
// store.
|
|
250
|
+
// Remove all stored data if necessary
|
|
251
|
+
// store.removeAll();
|
|
254
252
|
|
|
255
253
|
return (
|
|
256
254
|
<div>
|
|
@@ -278,7 +276,7 @@ Chrome: [Download from Google Web Store](https://chrome.google.com/webstore/deta
|
|
|
278
276
|
|
|
279
277
|
Edge: [Download from Microsoft Addons](https://microsoftedge.microsoft.com/addons/detail/dphelper-manager-dev-to/kphabkbdpaljlfagldhojilhfammepnk)
|
|
280
278
|
|
|
281
|
-
PS: **dpHelper** is compatible with all Chromium-based browsers like **Brave
|
|
279
|
+
PS: **dpHelper** is compatible with all Chromium-based browsers like **Edge or Brave**!
|
|
282
280
|
|
|
283
281
|
## dpHelper Browser Extension
|
|
284
282
|
|
|
@@ -300,10 +298,10 @@ The dpHelper browser extension allows you to manage your application's dpHelper
|
|
|
300
298
|
|
|
301
299
|
[MIT - https://en.wikipedia.org/wiki/MIT_License](https://en.wikipedia.org/wiki/MIT_License)
|
|
302
300
|
|
|
303
|
-
- [LICENCE](https://passariello.gitbook.io/dphelper-devtools/
|
|
304
|
-
- [CODE OF CONDUCT](https://passariello.gitbook.io/dphelper-devtools/
|
|
305
|
-
- [SECURITY](https://passariello.gitbook.io/dphelper-devtools/
|
|
306
|
-
- [CONTRIBUTING](https://passariello.gitbook.io/dphelper-devtools/
|
|
301
|
+
- [LICENCE](https://passariello.gitbook.io/dphelper-devtools/documents/license)
|
|
302
|
+
- [CODE OF CONDUCT](https://passariello.gitbook.io/dphelper-devtools/documents/code_of_conduct)
|
|
303
|
+
- [SECURITY](https://passariello.gitbook.io/dphelper-devtools/documents/security)
|
|
304
|
+
- [CONTRIBUTING](https://passariello.gitbook.io/dphelper-devtools/documents/contributing)
|
|
307
305
|
|
|
308
306
|
---
|
|
309
307
|
|
package/docs/index.md
CHANGED
|
@@ -141,8 +141,6 @@ state.removeAll()
|
|
|
141
141
|
|
|
142
142
|
**Note**: _Observer works only with states. Stores are excluded at the moment._
|
|
143
143
|
|
|
144
|
-
🔥NEW🔥: Great, now you can use nested objects in observer. You need to declare "state." or "store." before selecting the object you want to monitor.
|
|
145
|
-
|
|
146
144
|
If you want to run a function every time a state changes, you can use:
|
|
147
145
|
|
|
148
146
|
```javascript
|
|
@@ -208,7 +206,7 @@ When using dpHelper for permanent storage, you should use the **store**, which s
|
|
|
208
206
|
|
|
209
207
|
2. **Remove data when necessary:** To maintain security, remove stored data when it is no longer needed, such as during logout.
|
|
210
208
|
|
|
211
|
-
3. **
|
|
209
|
+
3. **Remove all stored data:** Use store.removeAll() to securely remove all stored data from your application.
|
|
212
210
|
|
|
213
211
|
```javascript
|
|
214
212
|
// Set a store:
|
|
@@ -218,10 +216,10 @@ store.set("test", { test: "test" })
|
|
|
218
216
|
store.get("test") // Output: { test: "test" }
|
|
219
217
|
|
|
220
218
|
// Remove a store:
|
|
221
|
-
store.
|
|
219
|
+
store.remove("test") // Output: "ok"
|
|
222
220
|
|
|
223
221
|
// Remove all stores:
|
|
224
|
-
store.
|
|
222
|
+
store.removeAll() // Output: "ok"
|
|
225
223
|
```
|
|
226
224
|
|
|
227
225
|
### Example in React
|
|
@@ -249,8 +247,8 @@ function App() {
|
|
|
249
247
|
}, []
|
|
250
248
|
);
|
|
251
249
|
|
|
252
|
-
//
|
|
253
|
-
// store.
|
|
250
|
+
// Remove all stored data if necessary
|
|
251
|
+
// store.removeAll();
|
|
254
252
|
|
|
255
253
|
return (
|
|
256
254
|
<div>
|
|
@@ -278,7 +276,7 @@ Chrome: [Download from Google Web Store](https://chrome.google.com/webstore/deta
|
|
|
278
276
|
|
|
279
277
|
Edge: [Download from Microsoft Addons](https://microsoftedge.microsoft.com/addons/detail/dphelper-manager-dev-to/kphabkbdpaljlfagldhojilhfammepnk)
|
|
280
278
|
|
|
281
|
-
PS: **dpHelper** is compatible with all Chromium-based browsers like **Brave
|
|
279
|
+
PS: **dpHelper** is compatible with all Chromium-based browsers like **Edge or Brave**!
|
|
282
280
|
|
|
283
281
|
## dpHelper Browser Extension
|
|
284
282
|
|
|
@@ -300,10 +298,10 @@ The dpHelper browser extension allows you to manage your application's dpHelper
|
|
|
300
298
|
|
|
301
299
|
[MIT - https://en.wikipedia.org/wiki/MIT_License](https://en.wikipedia.org/wiki/MIT_License)
|
|
302
300
|
|
|
303
|
-
- [LICENCE](https://passariello.gitbook.io/dphelper-devtools/
|
|
304
|
-
- [CODE OF CONDUCT](https://passariello.gitbook.io/dphelper-devtools/
|
|
305
|
-
- [SECURITY](https://passariello.gitbook.io/dphelper-devtools/
|
|
306
|
-
- [CONTRIBUTING](https://passariello.gitbook.io/dphelper-devtools/
|
|
301
|
+
- [LICENCE](https://passariello.gitbook.io/dphelper-devtools/documents/license)
|
|
302
|
+
- [CODE OF CONDUCT](https://passariello.gitbook.io/dphelper-devtools/documents/code_of_conduct)
|
|
303
|
+
- [SECURITY](https://passariello.gitbook.io/dphelper-devtools/documents/security)
|
|
304
|
+
- [CONTRIBUTING](https://passariello.gitbook.io/dphelper-devtools/documents/contributing)
|
|
307
305
|
|
|
308
306
|
---
|
|
309
307
|
|
package/documents/STORE.md
CHANGED
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
# dpHelper Store
|
|
2
|
-
|
|
3
|
-
## Overview
|
|
4
|
-
This document provides a comprehensive list of all available store functions in the `dphelper` library along with their descriptions and examples.
|
|
5
|
-
|
|
6
|
-
## Functions
|
|
7
|
-
|
|
8
|
-
### store.get([store.name])
|
|
9
|
-
- **Description:** Retrieve an item from local storage.
|
|
10
|
-
- **Parameters:**
|
|
11
|
-
- `name` (string): The name of the item to retrieve.
|
|
12
|
-
- **Example:**
|
|
13
|
-
```javascript
|
|
14
|
-
const value = store.get('itemName');
|
|
15
|
-
console.log(value);
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
### store.set([name, value])
|
|
19
|
-
- **Description:** Set an item in local storage.
|
|
20
|
-
- **Parameters:**
|
|
21
|
-
- `name` (string): The name of the item to set.
|
|
22
|
-
- `value` (any): The value of the item to set.
|
|
23
|
-
- **Example:**
|
|
24
|
-
```javascript
|
|
25
|
-
store.set('itemName', value);
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
### store.
|
|
29
|
-
- **Description:** Delete an item from local storage.
|
|
30
|
-
- **Parameters:**
|
|
31
|
-
- `name` (string): The name of the item to delete.
|
|
32
|
-
- **Example:**
|
|
33
|
-
```javascript
|
|
34
|
-
store.
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
### store.
|
|
38
|
-
- **Description:**
|
|
39
|
-
- **Parameters:** None
|
|
40
|
-
- **Example:**
|
|
41
|
-
```javascript
|
|
42
|
-
store.
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
### store.quota()
|
|
46
|
-
- **Description:** Estimate the storage quota and usage.
|
|
47
|
-
- **Parameters:** None
|
|
48
|
-
- **Example:**
|
|
49
|
-
```javascript
|
|
50
|
-
const quota = store.quota();
|
|
51
|
-
console.log(quota);
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
### store.size()
|
|
55
|
-
- **Description:** Calculate the total size of all items in local storage.
|
|
56
|
-
- **Parameters:** None
|
|
57
|
-
- **Example:**
|
|
58
|
-
```javascript
|
|
59
|
-
const totalSize = store.size();
|
|
60
|
-
console.log(totalSize);
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
## License
|
|
64
|
-
This project is licensed under the MIT License.
|
|
1
|
+
# dpHelper Store
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
This document provides a comprehensive list of all available store functions in the `dphelper` library along with their descriptions and examples.
|
|
5
|
+
|
|
6
|
+
## Functions
|
|
7
|
+
|
|
8
|
+
### store.get([store.name])
|
|
9
|
+
- **Description:** Retrieve an item from local storage.
|
|
10
|
+
- **Parameters:**
|
|
11
|
+
- `name` (string): The name of the item to retrieve.
|
|
12
|
+
- **Example:**
|
|
13
|
+
```javascript
|
|
14
|
+
const value = store.get('itemName');
|
|
15
|
+
console.log(value);
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### store.set([name, value])
|
|
19
|
+
- **Description:** Set an item in local storage.
|
|
20
|
+
- **Parameters:**
|
|
21
|
+
- `name` (string): The name of the item to set.
|
|
22
|
+
- `value` (any): The value of the item to set.
|
|
23
|
+
- **Example:**
|
|
24
|
+
```javascript
|
|
25
|
+
store.set('itemName', value);
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### store.remove([store.name])
|
|
29
|
+
- **Description:** Delete an item from local storage.
|
|
30
|
+
- **Parameters:**
|
|
31
|
+
- `name` (string): The name of the item to delete.
|
|
32
|
+
- **Example:**
|
|
33
|
+
```javascript
|
|
34
|
+
store.remove('itemName');
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### store.removeAll()
|
|
38
|
+
- **Description:** Remove all items from local storage.
|
|
39
|
+
- **Parameters:** None
|
|
40
|
+
- **Example:**
|
|
41
|
+
```javascript
|
|
42
|
+
store.removeAll();
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### store.quota()
|
|
46
|
+
- **Description:** Estimate the storage quota and usage.
|
|
47
|
+
- **Parameters:** None
|
|
48
|
+
- **Example:**
|
|
49
|
+
```javascript
|
|
50
|
+
const quota = store.quota();
|
|
51
|
+
console.log(quota);
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### store.size()
|
|
55
|
+
- **Description:** Calculate the total size of all items in local storage.
|
|
56
|
+
- **Parameters:** None
|
|
57
|
+
- **Example:**
|
|
58
|
+
```javascript
|
|
59
|
+
const totalSize = store.size();
|
|
60
|
+
console.log(totalSize);
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## License
|
|
64
|
+
This project is licensed under the MIT License.
|