@vnejs/plugins.core.storage 0.1.0 → 0.1.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.
@@ -13,6 +13,7 @@ export class Storage extends Module {
13
13
  this.on(this.EVENTS.STORAGE.EXPORT, this.onStorageExport);
14
14
  this.on(this.EVENTS.STORAGE.IMPORT, this.onStorageImport);
15
15
  this.on(this.EVENTS.STORAGE.CLEAR, this.onStorageClear);
16
+ this.on(this.EVENTS.STORAGE.CHANGED, this.onStorageChanged);
16
17
  };
17
18
  init = () =>
18
19
  new Promise((resolve) => {
@@ -30,7 +31,6 @@ export class Storage extends Module {
30
31
 
31
32
  this.emit(this.EVENTS.STORAGE.CHANGED);
32
33
  };
33
-
34
34
  onStorageSetAll = async ({ storage }) => {
35
35
  if (!this.isReady) await this.waitIsReady();
36
36
 
@@ -61,7 +61,6 @@ export class Storage extends Module {
61
61
 
62
62
  return wasChanged;
63
63
  };
64
-
65
64
  onStorageGet = async ({ prefix = "", key = "" } = {}) => {
66
65
  if (!this.isReady) await this.waitIsReady();
67
66
 
@@ -84,7 +83,6 @@ export class Storage extends Module {
84
83
 
85
84
  return result;
86
85
  };
87
-
88
86
  onStorageRm = async ({ prefix = "", key = "" } = {}) => {
89
87
  if (!this.isReady) await this.waitIsReady();
90
88
 
@@ -92,7 +90,6 @@ export class Storage extends Module {
92
90
 
93
91
  this.emit(this.EVENTS.STORAGE.CHANGED);
94
92
  };
95
-
96
93
  onStorageExport = async () => {
97
94
  if (!this.isReady) await this.waitIsReady();
98
95
 
@@ -102,7 +99,6 @@ export class Storage extends Module {
102
99
 
103
100
  return state;
104
101
  };
105
-
106
102
  onStorageImport = async () => {
107
103
  if (!this.isReady) await this.waitIsReady();
108
104
 
@@ -116,7 +112,6 @@ export class Storage extends Module {
116
112
 
117
113
  await this.emit(this.EVENTS.SYSTEM.RELOAD);
118
114
  };
119
-
120
115
  onStorageClear = async () => {
121
116
  if (!this.isReady) await this.waitIsReady();
122
117
 
@@ -126,4 +121,5 @@ export class Storage extends Module {
126
121
 
127
122
  await this.emit(this.EVENTS.SYSTEM.RELOAD);
128
123
  };
124
+ onStorageChanged = () => this.emit(this.EVENTS.LOGS.EMIT, { module: this.name, value: { action: "changed" } });
129
125
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vnejs/plugins.core.storage",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",
@@ -16,9 +16,5 @@
16
16
  "description": "",
17
17
  "dependencies": {
18
18
  "localforage": "1.10.0"
19
- },
20
- "peerDependencies": {
21
- "@vnejs/shared": "*",
22
- "@vnejs/module": "*"
23
19
  }
24
20
  }