@thzero/library_client_vue3_store_pinia 0.18.34 → 0.18.36
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/package.json +4 -4
- package/store/index.js +15 -8
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thzero/library_client_vue3_store_pinia",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.36",
|
|
4
4
|
"version_major": 0,
|
|
5
5
|
"version_minor": 18,
|
|
6
|
-
"version_patch":
|
|
7
|
-
"version_date": "
|
|
6
|
+
"version_patch": 36,
|
|
7
|
+
"version_date": "06/19/2026",
|
|
8
8
|
"description": "An opinionated library for vue3 with pinia store for the library_client_vue3 using the https://prazdevs.github.io/pinia-plugin-persistedstate library.",
|
|
9
9
|
"author": "thZero",
|
|
10
10
|
"author_url": "https://www.thzero.com",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"pinia": "^3.0.4",
|
|
26
26
|
"pinia-plugin-persistedstate": "^4.7.1",
|
|
27
27
|
"pinia-plugin-persistedstate-2": "^2.0.32",
|
|
28
|
-
"vue": "^3.5.
|
|
28
|
+
"vue": "^3.5.38"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
31
|
"@thzero/library_client": "^0.18",
|
package/store/index.js
CHANGED
|
@@ -78,10 +78,12 @@ class BaseStore {
|
|
|
78
78
|
// options.addModule('adminUsers', adminUsers, options.actionDispatcher, pluginPersistType, options.pluginPersistConfig, options.pinia, logger);
|
|
79
79
|
// storeFuncModules.push(options.addModule('news', news, options.actionDispatcher, options.actionGetters, storeConfig.persist, pluginPersistType, options.pluginPersistSetup, options.pluginPersistSetupOverride, options.pinia, logger));
|
|
80
80
|
// storeFuncModules.push(options.addModule('user', user, options.actionDispatcher, options.actionGetters, storeConfig.persist, pluginPersistType, options.pluginPersistSetup, options.pluginPersistSetupOverride, options.pinia, logger));
|
|
81
|
-
storeFuncModules.push(options.
|
|
82
|
-
storeFuncModules.push(options.
|
|
81
|
+
storeFuncModules.push(options.initModule('news', news, options.actionDispatcher, options.actionGetters, storeConfig.persist, pluginPersistType, options.pluginPersistSetup, options.pluginPersistSetupOverride, options.pinia));
|
|
82
|
+
storeFuncModules.push(options.initModule('user', user, options.actionDispatcher, options.actionGetters, storeConfig.persist, pluginPersistType, options.pluginPersistSetup, options.pluginPersistSetupOverride, options.pinia));
|
|
83
83
|
|
|
84
|
-
|
|
84
|
+
const modules = options.initModules(options.addModule);
|
|
85
|
+
for(const module of modules)
|
|
86
|
+
storeFuncModules.push(options.initModule(module.key, module.storeConfig, options.actionDispatcher, options.actionGetters, storeConfig.persist, pluginPersistType, options.pluginPersistSetup, options.pluginPersistSetupOverride, options.pinia));
|
|
85
87
|
|
|
86
88
|
LibraryClientUtility.$store.dispatcher = options.actionDispatcher;
|
|
87
89
|
LibraryClientUtility.$store.getters = options.actionGetters;
|
|
@@ -91,6 +93,7 @@ class BaseStore {
|
|
|
91
93
|
actionDispatcher: this.actionDispatcher,
|
|
92
94
|
actionGetters: this.actionGetters,
|
|
93
95
|
addModule: this._addModule,
|
|
96
|
+
initModule: this._initModule,
|
|
94
97
|
initModules: this._initModules,
|
|
95
98
|
// logger: logger,
|
|
96
99
|
pinia: this.pinia,
|
|
@@ -103,8 +106,12 @@ class BaseStore {
|
|
|
103
106
|
};
|
|
104
107
|
}
|
|
105
108
|
|
|
109
|
+
_addModule(key, storeConfig) {
|
|
110
|
+
return { key: key, storeConfig: storeConfig };
|
|
111
|
+
}
|
|
112
|
+
|
|
106
113
|
// _addModule(key, storeConfig, actionDispatcher, actionGetters, pluginPersistConfig, pluginPersistType, pluginPersistSetup, pluginPersistSetupOverride, pinia, logger) {
|
|
107
|
-
|
|
114
|
+
_initModule(key, storeConfig, actionDispatcher, actionGetters, pluginPersistConfig, pluginPersistType, pluginPersistSetup, pluginPersistSetupOverride, pinia) {
|
|
108
115
|
if (pluginPersistType && pluginPersistSetup && storeConfig.pluginPersistPaths && storeConfig.pluginPersistPaths[pluginPersistType]) {
|
|
109
116
|
pluginPersistConfig = LibraryCommonUtility.cloneDeep(pluginPersistConfig);
|
|
110
117
|
pluginPersistSetup(pluginPersistType, storeConfig, pluginPersistConfig, pluginPersistSetupOverride, {
|
|
@@ -130,10 +137,6 @@ class BaseStore {
|
|
|
130
137
|
return { key: key, storeFunc: storeFunc };
|
|
131
138
|
}
|
|
132
139
|
|
|
133
|
-
_initModules() {
|
|
134
|
-
return [];
|
|
135
|
-
}
|
|
136
|
-
|
|
137
140
|
_initPluginPersist() {
|
|
138
141
|
if (this._initPluginPersistType() === BaseStore.PersistanceTypePersist) {
|
|
139
142
|
this.pinia.use(piniaPluginPersistedState);
|
|
@@ -155,6 +158,10 @@ class BaseStore {
|
|
|
155
158
|
throw Error('Unknown persistance engine for Pinia store.');
|
|
156
159
|
}
|
|
157
160
|
|
|
161
|
+
_initModules() {
|
|
162
|
+
return null;
|
|
163
|
+
}
|
|
164
|
+
|
|
158
165
|
_initPluginPersistConfig() {
|
|
159
166
|
return null;
|
|
160
167
|
}
|