zova-module-a-model 5.0.12 → 5.0.13
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zova-module-a-model",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.13",
|
|
4
4
|
"title": "a-model",
|
|
5
5
|
"zovaModule": {
|
|
6
6
|
"capabilities": {
|
|
@@ -14,12 +14,6 @@
|
|
|
14
14
|
],
|
|
15
15
|
"output": "tanstack"
|
|
16
16
|
},
|
|
17
|
-
{
|
|
18
|
-
"match": [
|
|
19
|
-
"js-cookie"
|
|
20
|
-
],
|
|
21
|
-
"output": "js-cookie"
|
|
22
|
-
},
|
|
23
17
|
{
|
|
24
18
|
"match": [
|
|
25
19
|
"localforage"
|
|
@@ -59,9 +53,7 @@
|
|
|
59
53
|
"dependencies": {
|
|
60
54
|
"@tanstack/query-persist-client-core": "^5.45.0",
|
|
61
55
|
"@tanstack/vue-query": "^5.45.0",
|
|
62
|
-
"@types/js-cookie": "^3.0.6",
|
|
63
|
-
"js-cookie": "^3.0.5",
|
|
64
56
|
"localforage": "^1.10.0"
|
|
65
57
|
},
|
|
66
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "14e181241069cfa0d5325cfb19f21259420c19de"
|
|
67
59
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { QueryMetaPersister } from '../../types.js';
|
|
2
2
|
import { experimental_createPersister } from '@tanstack/query-persist-client-core';
|
|
3
3
|
import { Query, QueryKey } from '@tanstack/vue-query';
|
|
4
|
-
import { cookieStorage } from '../../common/cookieStorage.js';
|
|
5
4
|
import localforage from 'localforage';
|
|
6
5
|
import { SymbolBeanFullName } from 'zova';
|
|
7
6
|
import { BeanModelLast } from './bean.model.last.js';
|
|
@@ -125,7 +124,7 @@ export class BeanModelPersister<TScopeModule = unknown> extends BeanModelLast<TS
|
|
|
125
124
|
protected _getPersisterStorage(options?: QueryMetaPersister | boolean) {
|
|
126
125
|
options = this._adjustPersisterOptions(options);
|
|
127
126
|
if (!options) return undefined;
|
|
128
|
-
if (options.storage === 'cookie') return
|
|
127
|
+
if (options.storage === 'cookie') return this.app.meta.cookie;
|
|
129
128
|
if (options.storage === 'local') return localStorage;
|
|
130
129
|
if (options.storage === 'db') return localforage;
|
|
131
130
|
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import Cookies from 'js-cookie';
|
|
2
|
-
|
|
3
|
-
export const cookieStorage = {
|
|
4
|
-
getItem(key: string): string | undefined {
|
|
5
|
-
return Cookies.get(key);
|
|
6
|
-
},
|
|
7
|
-
setItem(key: string, value: string): void {
|
|
8
|
-
Cookies.set(key, value);
|
|
9
|
-
},
|
|
10
|
-
removeItem(key: string): void {
|
|
11
|
-
Cookies.remove(key);
|
|
12
|
-
},
|
|
13
|
-
};
|