dphelper 1.9.74 → 1.9.80
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/LICENSE.md +21 -0
- package/package.json +30 -75
- package/docs/_config.yml +0 -1
- package/docs/index.md +0 -374
- package/documents/OBSERVER.md +0 -67
- package/documents/SESSION.md +0 -58
- package/documents/STATE.md +0 -69
- package/documents/STORE.md +0 -80
- package/documents/TOOLS.md +0 -1284
- package/documents/USEOBSERVER.md +0 -30
- package/index.d.ts +0 -22
- package/index.js +0 -1
- package/types/cache.d.ts +0 -27
- package/types/dphelper.d.ts +0 -572
- package/types/idb.d.ts +0 -21
- package/types/jquery.d.ts +0 -20
- package/types/memorio.d.ts +0 -21
- package/types/observer.d.ts +0 -47
- package/types/session.d.ts +0 -67
- package/types/state.d.ts +0 -71
- package/types/store.d.ts +0 -91
- package/types/useobserver.d.ts +0 -28
package/documents/STATE.md
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
# dpHelper State
|
|
2
|
-
|
|
3
|
-
## Overview
|
|
4
|
-
|
|
5
|
-
This document provides a comprehensive list of all available state functions in the `dphelper` library along with their descriptions and examples.
|
|
6
|
-
|
|
7
|
-
**Based on [Memorio](https://www.npmjs.com/package/memorio) by Dario Passariello** to manage STATE, STORE, SESSION and OBSERVER. You can use Memorio is you need only state management. DpHelper is indicate when you use a complete suite of tools.
|
|
8
|
-
|
|
9
|
-
## Functions
|
|
10
|
-
|
|
11
|
-
### state.[state.name] ex: _state.test_
|
|
12
|
-
|
|
13
|
-
- **Description:** Set and get state values.
|
|
14
|
-
- **Example:**
|
|
15
|
-
|
|
16
|
-
```javascript
|
|
17
|
-
// To set a state value
|
|
18
|
-
state.name = 'value';
|
|
19
|
-
|
|
20
|
-
// To get a state value
|
|
21
|
-
const value = state.name;
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
### state.list
|
|
25
|
-
|
|
26
|
-
- **Description:** Show all states out of proxy.
|
|
27
|
-
- **Example:**
|
|
28
|
-
|
|
29
|
-
```javascript
|
|
30
|
-
state.list;
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
### state.remove([state.name])
|
|
34
|
-
|
|
35
|
-
- **Description:** Remove a state.
|
|
36
|
-
- **Parameters:**
|
|
37
|
-
- `name` (string): The name of the state to remove.
|
|
38
|
-
- **Example:**
|
|
39
|
-
|
|
40
|
-
```javascript
|
|
41
|
-
state.remove('stateName');
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
### state.name.lock()
|
|
45
|
-
|
|
46
|
-
- **Description:** Lock a state (only for types: Array, Object).
|
|
47
|
-
- **Example:**
|
|
48
|
-
|
|
49
|
-
```javascript
|
|
50
|
-
state.name = {test:"test"}
|
|
51
|
-
state.name.lock();
|
|
52
|
-
"Now you can't add more data or remove it"
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
### state.removeAll()
|
|
56
|
-
|
|
57
|
-
- **Description:** Remove all states.
|
|
58
|
-
- **Example:**
|
|
59
|
-
|
|
60
|
-
```javascript
|
|
61
|
-
state.name = {test:"test"}
|
|
62
|
-
state.removeAll();
|
|
63
|
-
"Now you can't see state.name (all states are removed)"
|
|
64
|
-
"Use for Log-out / Sign-out operation"
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
## License
|
|
68
|
-
|
|
69
|
-
This project is licensed under the MIT License.
|
package/documents/STORE.md
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
# dpHelper Store
|
|
2
|
-
|
|
3
|
-
## Overview
|
|
4
|
-
|
|
5
|
-
This document provides a comprehensive list of all available store functions in the `dphelper` library along with their descriptions and examples.
|
|
6
|
-
|
|
7
|
-
**Based on [Memorio](https://www.npmjs.com/package/memorio) by Dario Passariello** to manage STATE, STORE, SESSION and OBSERVER. You can use Memorio is you need only state management. DpHelper is indicate when you use a complete suite of tools.
|
|
8
|
-
|
|
9
|
-
## Functions
|
|
10
|
-
|
|
11
|
-
### store.get([store.name])
|
|
12
|
-
|
|
13
|
-
- **Description:** Retrieve an item from local storage.
|
|
14
|
-
- **Parameters:**
|
|
15
|
-
- `name` (string): The name of the item to retrieve.
|
|
16
|
-
- **Example:**
|
|
17
|
-
|
|
18
|
-
```javascript
|
|
19
|
-
const value = store.get('itemName');
|
|
20
|
-
console.log(value);
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
### store.set([name, value])
|
|
24
|
-
|
|
25
|
-
- **Description:** Set an item in local storage.
|
|
26
|
-
- **Parameters:**
|
|
27
|
-
- `name` (string): The name of the item to set.
|
|
28
|
-
- `value` (any): The value of the item to set.
|
|
29
|
-
- **Example:**
|
|
30
|
-
|
|
31
|
-
```javascript
|
|
32
|
-
store.set('itemName', value);
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
### store.remove([store.name])
|
|
36
|
-
|
|
37
|
-
- **Description:** Delete an item from local storage.
|
|
38
|
-
- **Parameters:**
|
|
39
|
-
- `name` (string): The name of the item to delete.
|
|
40
|
-
- **Example:**
|
|
41
|
-
|
|
42
|
-
```javascript
|
|
43
|
-
store.remove('itemName');
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
### store.removeAll()
|
|
47
|
-
|
|
48
|
-
- **Description:** Remove all items from local storage.
|
|
49
|
-
- **Parameters:** None
|
|
50
|
-
- **Example:**
|
|
51
|
-
|
|
52
|
-
```javascript
|
|
53
|
-
store.removeAll();
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
### store.quota()
|
|
57
|
-
|
|
58
|
-
- **Description:** Estimate the storage quota and usage.
|
|
59
|
-
- **Parameters:** None
|
|
60
|
-
- **Example:**
|
|
61
|
-
|
|
62
|
-
```javascript
|
|
63
|
-
const quota = store.quota();
|
|
64
|
-
console.log(quota);
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
### store.size()
|
|
68
|
-
|
|
69
|
-
- **Description:** Calculate the total size of all items in local storage.
|
|
70
|
-
- **Parameters:** None
|
|
71
|
-
- **Example:**
|
|
72
|
-
|
|
73
|
-
```javascript
|
|
74
|
-
const totalSize = store.size();
|
|
75
|
-
console.log(totalSize);
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
## License
|
|
79
|
-
|
|
80
|
-
This project is licensed under the MIT License.
|