dphelper 1.8.15 → 1.8.17
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 +29 -19
- package/dependabot.yml +4 -4
- package/docs/index.md +29 -19
- package/index.js +3 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -56,27 +56,37 @@ dpHelper is compatible with a variety of frontend libraries, including:
|
|
|
56
56
|
* Vue
|
|
57
57
|
* And any other frontend library
|
|
58
58
|
|
|
59
|
+
## Documentation
|
|
60
|
+
|
|
61
|
+
You can see more tutorials, information and example about **dpHelper** [clicking here](https://passariello.github.io/dpHelper/)
|
|
62
|
+
|
|
59
63
|
## What you need to know about "no-refresh/reload" 🧐
|
|
60
64
|
|
|
61
65
|
### dpHelper Compatibility and AJAX Technology
|
|
62
66
|
|
|
63
|
-
dpHelper is primarily designed to work with websites, applications, and portals that use **AJAX/XMLHttpRequest technology**, such as:
|
|
67
|
+
dpHelper is primarily designed to work with websites, SPA, SaaS applications, and portals that use **AJAX/XMLHttpRequest technology**, such as:
|
|
64
68
|
|
|
65
69
|
1. PWA (Progressive Web Apps)
|
|
66
70
|
2. SPA (Single-Page Applications)
|
|
71
|
+
3. SaaS
|
|
72
|
+
4. Microservice
|
|
73
|
+
|
|
74
|
+
and more...
|
|
75
|
+
|
|
76
|
+
is also indicate to work with and for:
|
|
77
|
+
|
|
78
|
+
1. React
|
|
79
|
+
2. jQuery
|
|
67
80
|
3. Angular
|
|
68
|
-
4.
|
|
69
|
-
5.
|
|
70
|
-
|
|
81
|
+
4. Vue
|
|
82
|
+
5. Vanilla
|
|
83
|
+
|
|
84
|
+
and more...
|
|
71
85
|
|
|
72
86
|
### What does this mean?
|
|
73
87
|
|
|
74
88
|
Modern browsers and applications use a **"NO REFRESH" behavior**, where only the affected parts of the page are re-rendered, rather than reloading the entire page. This can cause **data loss** when refreshing or reloading the page.
|
|
75
89
|
|
|
76
|
-
### Recommendation
|
|
77
|
-
|
|
78
|
-
If you want to use dpHelper as a state/store manager, consider using the **store function** in a non-AJAX engine. If you need help or more information, feel free to contact me.
|
|
79
|
-
|
|
80
90
|
#### You can find more information and related topics at the following links:
|
|
81
91
|
|
|
82
92
|
[Ajax_(programming)](https://en.wikipedia.org/wiki/Ajax_(programming))
|
|
@@ -85,19 +95,19 @@ If you want to use dpHelper as a state/store manager, consider using the **store
|
|
|
85
95
|
|
|
86
96
|
[XMLHttpRequest](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest)
|
|
87
97
|
|
|
98
|
+
### Recommendation
|
|
99
|
+
|
|
100
|
+
If you want to use dpHelper as a data manager, consider using the **store** function in a **non-AJAX engine**. If you need help or more information, feel free to contact me.
|
|
101
|
+
|
|
88
102
|
<!--You are not a tech guy, nerd or geek? ... no worries. Fix it... go to hiring one 🤭-->
|
|
89
103
|
|
|
90
|
-
## The Best Way To Use State
|
|
104
|
+
## The Best Way To Use State 💥
|
|
91
105
|
|
|
92
106
|
### Using the "state" Function
|
|
93
107
|
|
|
94
|
-
You can use the state function to store and reuse data throughout your application. Similar to other state managers, you can
|
|
108
|
+
You can use the state function to store and reuse data throughout your application. Similar to other state managers, you can save state information in JSON format and access it easily in various contexts, including React useEffect and / or dispatch.
|
|
95
109
|
|
|
96
|
-
|
|
97
|
-
2. useEffect
|
|
98
|
-
3. dispatch
|
|
99
|
-
|
|
100
|
-
For example, you can store a value like this: state.test = 'I am ready' and then retrieve it later using state.test.
|
|
110
|
+
For example, you can store a value like this: _state.test = 'I am ready'_ and then retrieve it later using state.test.
|
|
101
111
|
|
|
102
112
|
_example:_
|
|
103
113
|
|
|
@@ -118,9 +128,9 @@ state.list // or just state
|
|
|
118
128
|
state.remove("test")
|
|
119
129
|
```
|
|
120
130
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
**
|
|
131
|
+
### Observer 😎 for States
|
|
132
|
+
---
|
|
133
|
+
**Note**: _Observer works only with states. Stores are excluded at the moment._
|
|
124
134
|
|
|
125
135
|
If you want to run a function everytime a state change... you can use:
|
|
126
136
|
|
|
@@ -172,7 +182,7 @@ observer('myData', () => {
|
|
|
172
182
|
state.myData = 'New value';
|
|
173
183
|
```
|
|
174
184
|
|
|
175
|
-
##
|
|
185
|
+
## The Best Way To Use Store 🫙
|
|
176
186
|
|
|
177
187
|
### Persistent Storage with dpHelper
|
|
178
188
|
|
package/dependabot.yml
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
version: 2
|
|
7
7
|
updates:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
- package-ecosystem: "npm" # See documentation for possible values
|
|
9
|
+
directory: "/" # Location of package manifests
|
|
10
|
+
schedule:
|
|
11
|
+
interval: "weekly"
|
package/docs/index.md
CHANGED
|
@@ -56,27 +56,37 @@ dpHelper is compatible with a variety of frontend libraries, including:
|
|
|
56
56
|
* Vue
|
|
57
57
|
* And any other frontend library
|
|
58
58
|
|
|
59
|
+
## Documentation
|
|
60
|
+
|
|
61
|
+
You can see more tutorials, information and example about **dpHelper** [clicking here](https://passariello.github.io/dpHelper/)
|
|
62
|
+
|
|
59
63
|
## What you need to know about "no-refresh/reload" 🧐
|
|
60
64
|
|
|
61
65
|
### dpHelper Compatibility and AJAX Technology
|
|
62
66
|
|
|
63
|
-
dpHelper is primarily designed to work with websites, applications, and portals that use **AJAX/XMLHttpRequest technology**, such as:
|
|
67
|
+
dpHelper is primarily designed to work with websites, SPA, SaaS applications, and portals that use **AJAX/XMLHttpRequest technology**, such as:
|
|
64
68
|
|
|
65
69
|
1. PWA (Progressive Web Apps)
|
|
66
70
|
2. SPA (Single-Page Applications)
|
|
71
|
+
3. SaaS
|
|
72
|
+
4. Microservice
|
|
73
|
+
|
|
74
|
+
and more...
|
|
75
|
+
|
|
76
|
+
is also indicate to work with and for:
|
|
77
|
+
|
|
78
|
+
1. React
|
|
79
|
+
2. jQuery
|
|
67
80
|
3. Angular
|
|
68
|
-
4.
|
|
69
|
-
5.
|
|
70
|
-
|
|
81
|
+
4. Vue
|
|
82
|
+
5. Vanilla
|
|
83
|
+
|
|
84
|
+
and more...
|
|
71
85
|
|
|
72
86
|
### What does this mean?
|
|
73
87
|
|
|
74
88
|
Modern browsers and applications use a **"NO REFRESH" behavior**, where only the affected parts of the page are re-rendered, rather than reloading the entire page. This can cause **data loss** when refreshing or reloading the page.
|
|
75
89
|
|
|
76
|
-
### Recommendation
|
|
77
|
-
|
|
78
|
-
If you want to use dpHelper as a state/store manager, consider using the **store function** in a non-AJAX engine. If you need help or more information, feel free to contact me.
|
|
79
|
-
|
|
80
90
|
#### You can find more information and related topics at the following links:
|
|
81
91
|
|
|
82
92
|
[Ajax_(programming)](https://en.wikipedia.org/wiki/Ajax_(programming))
|
|
@@ -85,19 +95,19 @@ If you want to use dpHelper as a state/store manager, consider using the **store
|
|
|
85
95
|
|
|
86
96
|
[XMLHttpRequest](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest)
|
|
87
97
|
|
|
98
|
+
### Recommendation
|
|
99
|
+
|
|
100
|
+
If you want to use dpHelper as a data manager, consider using the **store** function in a **non-AJAX engine**. If you need help or more information, feel free to contact me.
|
|
101
|
+
|
|
88
102
|
<!--You are not a tech guy, nerd or geek? ... no worries. Fix it... go to hiring one 🤭-->
|
|
89
103
|
|
|
90
|
-
## The Best Way To Use State
|
|
104
|
+
## The Best Way To Use State 💥
|
|
91
105
|
|
|
92
106
|
### Using the "state" Function
|
|
93
107
|
|
|
94
|
-
You can use the state function to store and reuse data throughout your application. Similar to other state managers, you can
|
|
108
|
+
You can use the state function to store and reuse data throughout your application. Similar to other state managers, you can save state information in JSON format and access it easily in various contexts, including React useEffect and / or dispatch.
|
|
95
109
|
|
|
96
|
-
|
|
97
|
-
2. useEffect
|
|
98
|
-
3. dispatch
|
|
99
|
-
|
|
100
|
-
For example, you can store a value like this: state.test = 'I am ready' and then retrieve it later using state.test.
|
|
110
|
+
For example, you can store a value like this: _state.test = 'I am ready'_ and then retrieve it later using state.test.
|
|
101
111
|
|
|
102
112
|
_example:_
|
|
103
113
|
|
|
@@ -118,9 +128,9 @@ state.list // or just state
|
|
|
118
128
|
state.remove("test")
|
|
119
129
|
```
|
|
120
130
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
**
|
|
131
|
+
### Observer 😎 for States
|
|
132
|
+
---
|
|
133
|
+
**Note**: _Observer works only with states. Stores are excluded at the moment._
|
|
124
134
|
|
|
125
135
|
If you want to run a function everytime a state change... you can use:
|
|
126
136
|
|
|
@@ -172,7 +182,7 @@ observer('myData', () => {
|
|
|
172
182
|
state.myData = 'New value';
|
|
173
183
|
```
|
|
174
184
|
|
|
175
|
-
##
|
|
185
|
+
## The Best Way To Use Store 🫙
|
|
176
186
|
|
|
177
187
|
### Persistent Storage with dpHelper
|
|
178
188
|
|