dphelper 1.2.3 → 1.2.5

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/.github/README.md CHANGED
@@ -6,7 +6,7 @@ dpHelper Devtools by Dario Passariello
6
6
 
7
7
  ![dpHelper](https://raw.githubusercontent.com/passariello/dphelper/HEAD/assets/logos/logo.svg)
8
8
 
9
- Manager | DevTools by [Dario Passariello (c)](https://dario.passariello.ca)
9
+ Manager | DevTools by [Dario Passariello](https://dario.passariello.ca) (c)
10
10
 
11
11
  <!-- ![git repository](https://img.shields.io/badge/git%20repository-updated-green.svg) -->
12
12
  ![browser extension](https://img.shields.io/badge/browser%20extension-beta-orange.svg)
@@ -65,14 +65,36 @@ state
65
65
  If you want to run a funtion everytime a state change you can use:
66
66
 
67
67
  ```javascript
68
- observer("test",()=>alert("Test Changes to: " + state.test))
68
+ // Observer is a non cumulative listener, is trigged from customEvent / dispatch from state
69
+ observer(
70
+ "test",
71
+ ()=>alert("Test Changes to: " + state.test)
72
+ )
69
73
  ```
70
74
 
71
75
  You can use it everywere. Works like "useState" in react but with more flexibility
72
76
 
73
77
  ## State vs Store 🎅
74
78
 
75
- **INFO**: if you want to use as permanent storage (localStorage) you need to use " **store.** " instead state.
79
+ **INFO**: if you want to use as permanent storage (localStorage) you need to use " **store** " instead state.
80
+ **IMPORTANT**: Store use localStorage... data are persistant and you need to remove if necessary for security (like logout)
81
+
82
+ **SECURITY**: Do not store any sensitive data. Data stay in the computer if are not properly removed
83
+
84
+ ```javascript
85
+ // Set a store:
86
+ store.set("test",{test:"test"})
87
+
88
+ // Get a store:
89
+ store.get("test") -> {test:"test"}
90
+
91
+ // Remove a store:
92
+ store.delete("test") -> "ok"
93
+
94
+ // Remove all:
95
+ store.clearAll() -> "ok"
96
+
97
+ ```
76
98
 
77
99
  ---
78
100
 
package/README.md CHANGED
@@ -6,7 +6,7 @@ dpHelper Devtools by Dario Passariello
6
6
 
7
7
  ![dpHelper](https://raw.githubusercontent.com/passariello/dphelper/HEAD/assets/logos/logo.svg)
8
8
 
9
- Manager | DevTools by [Dario Passariello (c)](https://dario.passariello.ca)
9
+ Manager | DevTools by [Dario Passariello](https://dario.passariello.ca) (c)
10
10
 
11
11
  <!-- ![git repository](https://img.shields.io/badge/git%20repository-updated-green.svg) -->
12
12
  ![browser extension](https://img.shields.io/badge/browser%20extension-beta-orange.svg)
@@ -65,14 +65,36 @@ state
65
65
  If you want to run a funtion everytime a state change you can use:
66
66
 
67
67
  ```javascript
68
- observer("test",()=>alert("Test Changes to: " + state.test))
68
+ // Observer is a non cumulative listener, is trigged from customEvent / dispatch from state
69
+ observer(
70
+ "test",
71
+ ()=>alert("Test Changes to: " + state.test)
72
+ )
69
73
  ```
70
74
 
71
75
  You can use it everywere. Works like "useState" in react but with more flexibility
72
76
 
73
77
  ## State vs Store 🎅
74
78
 
75
- **INFO**: if you want to use as permanent storage (localStorage) you need to use " **store.** " instead state.
79
+ **INFO**: if you want to use as permanent storage (localStorage) you need to use " **store** " instead state.
80
+ **IMPORTANT**: Store use localStorage... data are persistant and you need to remove if necessary for security (like logout)
81
+
82
+ **SECURITY**: Do not store any sensitive data. Data stay in the computer if are not properly removed
83
+
84
+ ```javascript
85
+ // Set a store:
86
+ store.set("test",{test:"test"})
87
+
88
+ // Get a store:
89
+ store.get("test") -> {test:"test"}
90
+
91
+ // Remove a store:
92
+ store.delete("test") -> "ok"
93
+
94
+ // Remove all:
95
+ store.clearAll() -> "ok"
96
+
97
+ ```
76
98
 
77
99
  ---
78
100