slicejs-web-framework 3.3.2 → 3.3.4
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.
|
@@ -57,7 +57,8 @@ export default class ContextManager {
|
|
|
57
57
|
// Cargar estado persistido si existe
|
|
58
58
|
let state = initialState;
|
|
59
59
|
if (options.persist) {
|
|
60
|
-
const
|
|
60
|
+
const storageKey = options.storageKey || `slice_context_${name}`;
|
|
61
|
+
const persisted = this._loadFromStorage(storageKey);
|
|
61
62
|
if (persisted !== null) {
|
|
62
63
|
state = persisted;
|
|
63
64
|
}
|
|
@@ -332,15 +333,14 @@ export default class ContextManager {
|
|
|
332
333
|
/**
|
|
333
334
|
* Cargar estado desde localStorage
|
|
334
335
|
*/
|
|
335
|
-
_loadFromStorage(
|
|
336
|
+
_loadFromStorage(storageKey) {
|
|
336
337
|
try {
|
|
337
|
-
const
|
|
338
|
-
const data = localStorage.getItem(key);
|
|
338
|
+
const data = localStorage.getItem(storageKey);
|
|
339
339
|
if (data) {
|
|
340
340
|
return JSON.parse(data);
|
|
341
341
|
}
|
|
342
342
|
} catch (error) {
|
|
343
|
-
slice.logger.logWarning('ContextManager', `Error cargando "${
|
|
343
|
+
slice.logger.logWarning('ContextManager', `Error cargando "${storageKey}" de localStorage`, error);
|
|
344
344
|
}
|
|
345
345
|
return null;
|
|
346
346
|
}
|
package/api/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "slicejs-web-framework",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.4",
|
|
4
4
|
"description": "",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=20"
|
|
@@ -23,6 +23,10 @@
|
|
|
23
23
|
"author": "",
|
|
24
24
|
"license": "ISC",
|
|
25
25
|
"type": "module",
|
|
26
|
+
"exports": {
|
|
27
|
+
".": "./Slice/Slice.js",
|
|
28
|
+
"./api/framework/express.js": "./api/framework/express.js"
|
|
29
|
+
},
|
|
26
30
|
"types": "./types/index.d.ts",
|
|
27
31
|
"dependencies": {
|
|
28
32
|
"express": "^4.19.2"
|