@suey/rxp-meta 0.0.3 → 0.1.0
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/dist/commonjs/index.js +0 -3
- package/dist/commonjs/src/base/InnerZustandStoreManager.js +15 -12
- package/dist/commonjs/src/base/index.js +17 -0
- package/dist/commonjs/src/base/rxpInnerStore.js +65 -0
- package/dist/commonjs/src/constants/index.js +25 -0
- package/dist/commonjs/src/extension/At.js +113 -0
- package/dist/commonjs/src/extension/ExtensionManager.js +66 -101
- package/dist/commonjs/src/extension/ExtensionManager.old.js +156 -0
- package/dist/commonjs/src/metadata/MetadataManager.js +102 -100
- package/dist/commonjs/src/metadata/MetadataManager.old.js +171 -0
- package/dist/commonjs/tsconfig.tsbuildinfo +1 -1
- package/dist/esm/index.js +0 -1
- package/dist/esm/src/base/InnerZustandStoreManager.js +15 -12
- package/dist/esm/src/base/index.js +1 -0
- package/dist/esm/src/base/rxpInnerStore.js +61 -0
- package/dist/esm/src/constants/index.js +22 -0
- package/dist/esm/src/extension/At.js +109 -0
- package/dist/esm/src/extension/ExtensionManager.js +64 -100
- package/dist/esm/src/extension/ExtensionManager.old.js +152 -0
- package/dist/esm/src/metadata/MetadataManager.js +103 -101
- package/dist/esm/src/metadata/MetadataManager.old.js +167 -0
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/dist/lib/index.d.ts +0 -1
- package/dist/lib/src/base/InnerZustandStoreManager.d.ts +11 -3
- package/dist/lib/src/base/index.d.ts +1 -0
- package/dist/lib/src/base/rxpInnerStore.d.ts +40 -0
- package/dist/lib/src/constants/index.d.ts +19 -0
- package/dist/lib/src/extension/At.d.ts +53 -0
- package/dist/lib/src/extension/ExtensionManager.d.ts +52 -9
- package/dist/lib/src/extension/ExtensionManager.old.d.ts +52 -0
- package/dist/lib/src/extension/declare.d.ts +9 -8
- package/dist/lib/src/extension/index.d.ts +2 -1
- package/dist/lib/src/metadata/MetadataManager.d.ts +64 -15
- package/dist/lib/src/metadata/MetadataManager.old.d.ts +125 -0
- package/dist/lib/src/metadata/declare.d.ts +2 -12
- package/dist/lib/src/metadata/index.d.ts +0 -1
- package/dist/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -6
- package/dist/commonjs/src/rApp.js +0 -102
- package/dist/esm/src/rApp.js +0 -99
- package/dist/lib/src/rApp.d.ts +0 -99
|
@@ -2,152 +2,136 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MetadataManager = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
|
-
const
|
|
6
|
-
class MetadataManager
|
|
5
|
+
const index_1 = require("../base/index");
|
|
6
|
+
class MetadataManager {
|
|
7
|
+
rxpInnerStore = new index_1.RxpInnerStore();
|
|
7
8
|
metadataMap = new Map();
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
this.metadataChangeListeners.forEach(listener => listener(payload));
|
|
11
|
-
}
|
|
12
|
-
subscribeMetadataStoreChanged(listener) {
|
|
13
|
-
this.metadataChangeListeners.add(listener);
|
|
14
|
-
return () => {
|
|
15
|
-
this.metadataChangeListeners.delete(listener);
|
|
16
|
-
};
|
|
9
|
+
constructor() {
|
|
10
|
+
this.metadataMap.clear();
|
|
17
11
|
}
|
|
18
12
|
defineMetadata(metadataKey, metadata) {
|
|
19
13
|
this.metadataMap.set(metadataKey, metadata);
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
metadataKey: metadataKey,
|
|
25
|
-
metadata: metadata
|
|
26
|
-
});
|
|
14
|
+
this.rxpInnerStore.update();
|
|
15
|
+
return () => {
|
|
16
|
+
this.delMetadata(metadataKey);
|
|
17
|
+
};
|
|
27
18
|
}
|
|
28
19
|
getMetadata(metadataKey) {
|
|
29
20
|
return (this.metadataMap.get(metadataKey)) ?? null;
|
|
30
21
|
}
|
|
22
|
+
getMetadataLatestInVector(metadataKey) {
|
|
23
|
+
return (this.metadataMap.get(metadataKey) ?? [])[this.metadataMap.get(metadataKey)?.length - 1] ?? null;
|
|
24
|
+
}
|
|
25
|
+
getMetadataOldestInVector(metadataKey) {
|
|
26
|
+
return (this.metadataMap.get(metadataKey) ?? [])[0] ?? null;
|
|
27
|
+
}
|
|
31
28
|
delMetadata(metadataKey) {
|
|
32
29
|
if (!this.hasMetadata(metadataKey))
|
|
33
30
|
return;
|
|
34
31
|
this.metadataMap.delete(metadataKey);
|
|
35
|
-
|
|
36
|
-
this.triggerMetadataChangeListeners({
|
|
37
|
-
action: 'Remove',
|
|
38
|
-
type: 'All',
|
|
39
|
-
metadataKey: metadataKey,
|
|
40
|
-
metadata: this.metadataMap.get(metadataKey)
|
|
41
|
-
});
|
|
32
|
+
this.rxpInnerStore.update();
|
|
42
33
|
}
|
|
43
34
|
defineMetadataInSingle(metadataKey, metadata) {
|
|
44
35
|
this.metadataMap.set(metadataKey, metadata);
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
metadataKey: metadataKey,
|
|
50
|
-
metadata: metadata
|
|
51
|
-
});
|
|
36
|
+
this.rxpInnerStore.update();
|
|
37
|
+
return () => {
|
|
38
|
+
this.delMetadata(metadataKey);
|
|
39
|
+
};
|
|
52
40
|
}
|
|
53
41
|
defineMetadataInVector(metadataKey, metadata) {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
42
|
+
let hasThisMetadata = false;
|
|
43
|
+
if (this.hasMetadata(metadataKey)) {
|
|
44
|
+
const vector = this.metadataMap.get(metadataKey);
|
|
45
|
+
if (!Array.isArray(vector))
|
|
46
|
+
throw new Error(`defineMetadataInVector: current metadata value is not an array`);
|
|
47
|
+
const newVector = vector.map(v => {
|
|
48
|
+
if (v === metadata)
|
|
49
|
+
hasThisMetadata = true;
|
|
50
|
+
return v;
|
|
62
51
|
});
|
|
63
|
-
|
|
52
|
+
if (!hasThisMetadata) {
|
|
53
|
+
newVector.push(metadata);
|
|
54
|
+
this.metadataMap.set(metadataKey, newVector);
|
|
55
|
+
this.rxpInnerStore.update();
|
|
56
|
+
}
|
|
64
57
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
return;
|
|
71
|
-
vectorSet.add(metadata);
|
|
72
|
-
const newMetadata = Array.from(vectorSet);
|
|
73
|
-
this.metadataMap.set(metadataKey, newMetadata);
|
|
74
|
-
super.updateStore();
|
|
75
|
-
this.triggerMetadataChangeListeners({
|
|
76
|
-
action: 'Define',
|
|
77
|
-
type: 'Vector',
|
|
78
|
-
metadataKey: metadataKey,
|
|
79
|
-
metadata: newMetadata
|
|
80
|
-
});
|
|
58
|
+
else {
|
|
59
|
+
this.metadataMap.set(metadataKey, [metadata]);
|
|
60
|
+
this.rxpInnerStore.update();
|
|
61
|
+
}
|
|
62
|
+
return () => this.delMetadataInVector(metadataKey, metadata);
|
|
81
63
|
}
|
|
82
64
|
delMetadataInVector(metadataKey, metadata) {
|
|
83
65
|
if (!this.hasMetadata(metadataKey))
|
|
84
66
|
return;
|
|
85
|
-
|
|
67
|
+
let hasThisMetadata = false;
|
|
68
|
+
const vector = this.metadataMap.get(metadataKey) ?? [];
|
|
86
69
|
if (!Array.isArray(vector))
|
|
87
70
|
throw new Error(`delMetadataInVector: current metadata value is not an array`);
|
|
88
71
|
if (vector.length === 0) {
|
|
89
72
|
this.metadataMap.delete(metadataKey);
|
|
73
|
+
this.rxpInnerStore.update();
|
|
90
74
|
return;
|
|
91
75
|
}
|
|
92
|
-
const fVector = vector.filter(v =>
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
action: 'Remove',
|
|
98
|
-
type: 'Vector',
|
|
99
|
-
metadataKey: metadataKey,
|
|
100
|
-
metadata: []
|
|
101
|
-
});
|
|
102
|
-
return;
|
|
103
|
-
}
|
|
104
|
-
this.metadataMap.set(metadataKey, fVector);
|
|
105
|
-
super.updateStore();
|
|
106
|
-
this.triggerMetadataChangeListeners({
|
|
107
|
-
action: 'Remove',
|
|
108
|
-
type: 'Vector',
|
|
109
|
-
metadataKey: metadataKey,
|
|
110
|
-
metadata: fVector
|
|
76
|
+
const fVector = vector.filter(v => {
|
|
77
|
+
const isThisMetadata = (v === metadata);
|
|
78
|
+
if (isThisMetadata)
|
|
79
|
+
hasThisMetadata = true;
|
|
80
|
+
return !isThisMetadata;
|
|
111
81
|
});
|
|
82
|
+
if (hasThisMetadata) {
|
|
83
|
+
if (fVector.length === 0) {
|
|
84
|
+
this.metadataMap.delete(metadataKey);
|
|
85
|
+
this.rxpInnerStore.update();
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
this.metadataMap.set(metadataKey, fVector);
|
|
89
|
+
this.rxpInnerStore.update();
|
|
90
|
+
}
|
|
112
91
|
}
|
|
113
92
|
useMetadata(metadataKey) {
|
|
114
93
|
const [_, setState] = (0, react_1.useState)({});
|
|
115
|
-
const
|
|
94
|
+
const normalState = (0, react_1.useRef)({
|
|
116
95
|
isMounted: false,
|
|
117
96
|
data: this.getMetadata(metadataKey),
|
|
118
|
-
unsubscribe: void 0
|
|
119
|
-
}));
|
|
120
|
-
const [syncState] = (0, react_1.useState)(() => ({
|
|
97
|
+
unsubscribe: void 0,
|
|
121
98
|
needSync: false
|
|
122
|
-
})
|
|
123
|
-
const
|
|
124
|
-
if (!normalState.isMounted) {
|
|
125
|
-
|
|
99
|
+
});
|
|
100
|
+
const refreshComponent = (0, react_1.useCallback)(() => {
|
|
101
|
+
if (!normalState.current.isMounted) {
|
|
102
|
+
normalState.current.needSync = true;
|
|
126
103
|
return;
|
|
127
104
|
}
|
|
128
|
-
setState({});
|
|
105
|
+
setState(() => ({}));
|
|
129
106
|
}, []);
|
|
130
|
-
if (!normalState.unsubscribe) {
|
|
131
|
-
normalState.unsubscribe
|
|
107
|
+
if (!normalState.current.isMounted || !normalState.current.unsubscribe) {
|
|
108
|
+
if (normalState.current.unsubscribe)
|
|
109
|
+
normalState.current.unsubscribe();
|
|
110
|
+
normalState.current.data = this.getMetadata(metadataKey);
|
|
111
|
+
normalState.current.unsubscribe = this.rxpInnerStore.subscribe(() => {
|
|
132
112
|
const data = this.getMetadata(metadataKey);
|
|
133
|
-
if (data !== normalState.data) {
|
|
134
|
-
normalState.data = data;
|
|
135
|
-
|
|
113
|
+
if (data !== normalState.current.data) {
|
|
114
|
+
normalState.current.data = data;
|
|
115
|
+
refreshComponent();
|
|
136
116
|
}
|
|
137
117
|
});
|
|
138
118
|
}
|
|
139
119
|
(0, react_1.useLayoutEffect)(() => {
|
|
140
|
-
normalState.isMounted = true;
|
|
141
|
-
|
|
142
|
-
|
|
120
|
+
normalState.current.isMounted = true;
|
|
121
|
+
}, []);
|
|
122
|
+
(0, react_1.useEffect)(() => {
|
|
123
|
+
if (normalState.current.needSync)
|
|
124
|
+
setState(() => ({}));
|
|
143
125
|
return () => {
|
|
144
|
-
normalState.isMounted = false;
|
|
145
|
-
if (normalState.unsubscribe)
|
|
146
|
-
normalState.unsubscribe();
|
|
147
|
-
normalState.unsubscribe = void 0;
|
|
126
|
+
normalState.current.isMounted = false;
|
|
127
|
+
if (normalState.current.unsubscribe)
|
|
128
|
+
normalState.current.unsubscribe();
|
|
129
|
+
normalState.current.unsubscribe = void 0;
|
|
130
|
+
normalState.current.data = null;
|
|
131
|
+
normalState.current.needSync = false;
|
|
148
132
|
};
|
|
149
133
|
}, []);
|
|
150
|
-
return normalState.data;
|
|
134
|
+
return normalState.current.data;
|
|
151
135
|
}
|
|
152
136
|
useOldestMetadataInVector(metadataKey) {
|
|
153
137
|
const metadata = this.useMetadata(metadataKey);
|
|
@@ -162,11 +146,29 @@ class MetadataManager extends InnerZustandStoreManager_1.InnerZustandStoreManage
|
|
|
162
146
|
return null;
|
|
163
147
|
}
|
|
164
148
|
useAllMetadata() {
|
|
165
|
-
|
|
149
|
+
this.rxpInnerStore.useValueToRenderReactComponent();
|
|
166
150
|
return this.metadataMap;
|
|
167
151
|
}
|
|
168
152
|
hasMetadata(metadataKey) {
|
|
169
153
|
return this.metadataMap.has(metadataKey);
|
|
170
154
|
}
|
|
155
|
+
useFollowMetadata(metadataKey, metadata) {
|
|
156
|
+
(0, react_1.useEffect)(() => {
|
|
157
|
+
const destroy = this.defineMetadata(metadataKey, metadata);
|
|
158
|
+
return destroy;
|
|
159
|
+
}, [metadataKey, metadata]);
|
|
160
|
+
}
|
|
161
|
+
useFollowMetadataInVector(metadataKey, metadata) {
|
|
162
|
+
(0, react_1.useEffect)(() => {
|
|
163
|
+
const destroy = this.defineMetadataInVector(metadataKey, metadata);
|
|
164
|
+
return destroy;
|
|
165
|
+
}, [metadataKey, metadata]);
|
|
166
|
+
}
|
|
167
|
+
useFollowMetadataInSingle(metadataKey, metadata) {
|
|
168
|
+
(0, react_1.useEffect)(() => {
|
|
169
|
+
const destroy = this.defineMetadataInSingle(metadataKey, metadata);
|
|
170
|
+
return destroy;
|
|
171
|
+
}, [metadataKey, metadata]);
|
|
172
|
+
}
|
|
171
173
|
}
|
|
172
174
|
exports.MetadataManager = MetadataManager;
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MetadataManager = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const InnerZustandStoreManager_1 = require("../base/InnerZustandStoreManager");
|
|
6
|
+
class MetadataManager extends InnerZustandStoreManager_1.InnerZustandStoreManager {
|
|
7
|
+
metadataMap = new Map();
|
|
8
|
+
defineMetadata(metadataKey, metadata) {
|
|
9
|
+
this.metadataMap.set(metadataKey, metadata);
|
|
10
|
+
super.updateStore();
|
|
11
|
+
return () => {
|
|
12
|
+
this.delMetadata(metadataKey);
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
getMetadata(metadataKey) {
|
|
16
|
+
return (this.metadataMap.get(metadataKey)) ?? null;
|
|
17
|
+
}
|
|
18
|
+
getMetadataLatestInVector(metadataKey) {
|
|
19
|
+
return (this.metadataMap.get(metadataKey) ?? [])[this.metadataMap.get(metadataKey)?.length - 1] ?? null;
|
|
20
|
+
}
|
|
21
|
+
getMetadataOldestInVector(metadataKey) {
|
|
22
|
+
return (this.metadataMap.get(metadataKey) ?? [])[0] ?? null;
|
|
23
|
+
}
|
|
24
|
+
delMetadata(metadataKey) {
|
|
25
|
+
if (!this.hasMetadata(metadataKey))
|
|
26
|
+
return;
|
|
27
|
+
this.metadataMap.delete(metadataKey);
|
|
28
|
+
super.updateStore();
|
|
29
|
+
}
|
|
30
|
+
defineMetadataInSingle(metadataKey, metadata) {
|
|
31
|
+
this.metadataMap.set(metadataKey, metadata);
|
|
32
|
+
super.updateStore();
|
|
33
|
+
return () => {
|
|
34
|
+
this.delMetadata(metadataKey);
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
defineMetadataInVector(metadataKey, metadata) {
|
|
38
|
+
let hasThisMetadata = false;
|
|
39
|
+
if (this.hasMetadata(metadataKey)) {
|
|
40
|
+
const vector = this.metadataMap.get(metadataKey);
|
|
41
|
+
if (!Array.isArray(vector))
|
|
42
|
+
throw new Error(`defineMetadataInVector: current metadata value is not an array`);
|
|
43
|
+
const newVector = vector.filter(v => {
|
|
44
|
+
const isThisMetadata = (v === metadata);
|
|
45
|
+
if (isThisMetadata)
|
|
46
|
+
hasThisMetadata = true;
|
|
47
|
+
return !isThisMetadata;
|
|
48
|
+
});
|
|
49
|
+
if (!hasThisMetadata) {
|
|
50
|
+
newVector.push(metadata);
|
|
51
|
+
this.metadataMap.set(metadataKey, newVector);
|
|
52
|
+
super.updateStore();
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
this.metadataMap.set(metadataKey, [metadata]);
|
|
57
|
+
super.updateStore();
|
|
58
|
+
}
|
|
59
|
+
return () => this.delMetadataInVector(metadataKey, metadata);
|
|
60
|
+
}
|
|
61
|
+
delMetadataInVector(metadataKey, metadata) {
|
|
62
|
+
if (!this.hasMetadata(metadataKey))
|
|
63
|
+
return;
|
|
64
|
+
let hasThisMetadata = false;
|
|
65
|
+
const vector = this.metadataMap.get(metadataKey) ?? [];
|
|
66
|
+
if (!Array.isArray(vector))
|
|
67
|
+
throw new Error(`delMetadataInVector: current metadata value is not an array`);
|
|
68
|
+
if (vector.length === 0) {
|
|
69
|
+
this.metadataMap.delete(metadataKey);
|
|
70
|
+
super.updateStore();
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
const fVector = vector.filter(v => {
|
|
74
|
+
const isThisMetadata = (v === metadata);
|
|
75
|
+
if (isThisMetadata)
|
|
76
|
+
hasThisMetadata = true;
|
|
77
|
+
return !isThisMetadata;
|
|
78
|
+
});
|
|
79
|
+
if (hasThisMetadata) {
|
|
80
|
+
if (fVector.length === 0) {
|
|
81
|
+
this.metadataMap.delete(metadataKey);
|
|
82
|
+
super.updateStore();
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
this.metadataMap.set(metadataKey, fVector);
|
|
86
|
+
super.updateStore();
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
useMetadata(metadataKey) {
|
|
90
|
+
const [_, setState] = (0, react_1.useState)({});
|
|
91
|
+
const normalState = (0, react_1.useRef)({
|
|
92
|
+
isMounted: false,
|
|
93
|
+
data: this.getMetadata(metadataKey),
|
|
94
|
+
unsubscribe: void 0,
|
|
95
|
+
needSync: false
|
|
96
|
+
});
|
|
97
|
+
const refreshComponent = (0, react_1.useCallback)(() => {
|
|
98
|
+
if (!normalState.current.isMounted) {
|
|
99
|
+
normalState.current.needSync = true;
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
setState(() => ({}));
|
|
103
|
+
}, []);
|
|
104
|
+
if (!normalState.current.isMounted || !normalState.current.unsubscribe) {
|
|
105
|
+
if (normalState.current.unsubscribe)
|
|
106
|
+
normalState.current.unsubscribe();
|
|
107
|
+
normalState.current.data = this.getMetadata(metadataKey);
|
|
108
|
+
normalState.current.unsubscribe = super.subscribe(() => {
|
|
109
|
+
const data = this.getMetadata(metadataKey);
|
|
110
|
+
if (data !== normalState.current.data) {
|
|
111
|
+
normalState.current.data = data;
|
|
112
|
+
refreshComponent();
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
(0, react_1.useLayoutEffect)(() => {
|
|
117
|
+
normalState.current.isMounted = true;
|
|
118
|
+
}, []);
|
|
119
|
+
(0, react_1.useEffect)(() => {
|
|
120
|
+
if (normalState.current.needSync)
|
|
121
|
+
setState(() => ({}));
|
|
122
|
+
return () => {
|
|
123
|
+
normalState.current.isMounted = false;
|
|
124
|
+
if (normalState.current.unsubscribe)
|
|
125
|
+
normalState.current.unsubscribe();
|
|
126
|
+
normalState.current.unsubscribe = void 0;
|
|
127
|
+
normalState.current.data = null;
|
|
128
|
+
normalState.current.needSync = false;
|
|
129
|
+
};
|
|
130
|
+
}, []);
|
|
131
|
+
return normalState.current.data;
|
|
132
|
+
}
|
|
133
|
+
useOldestMetadataInVector(metadataKey) {
|
|
134
|
+
const metadata = this.useMetadata(metadataKey);
|
|
135
|
+
if (metadata && Array.isArray(metadata))
|
|
136
|
+
return metadata[0] ?? null;
|
|
137
|
+
return null;
|
|
138
|
+
}
|
|
139
|
+
useLatestMetadataInVector(metadataKey) {
|
|
140
|
+
const metadata = this.useMetadata(metadataKey);
|
|
141
|
+
if (metadata && Array.isArray(metadata))
|
|
142
|
+
return metadata[metadata.length - 1] ?? null;
|
|
143
|
+
return null;
|
|
144
|
+
}
|
|
145
|
+
useAllMetadata() {
|
|
146
|
+
super.useStoreValueToRerenderComponent();
|
|
147
|
+
return this.metadataMap;
|
|
148
|
+
}
|
|
149
|
+
hasMetadata(metadataKey) {
|
|
150
|
+
return this.metadataMap.has(metadataKey);
|
|
151
|
+
}
|
|
152
|
+
useFollowMetadata(metadataKey, metadata) {
|
|
153
|
+
(0, react_1.useEffect)(() => {
|
|
154
|
+
const destroy = this.defineMetadata(metadataKey, metadata);
|
|
155
|
+
return destroy;
|
|
156
|
+
}, [metadataKey, metadata]);
|
|
157
|
+
}
|
|
158
|
+
useFollowMetadataInVector(metadataKey, metadata) {
|
|
159
|
+
(0, react_1.useEffect)(() => {
|
|
160
|
+
const destroy = this.defineMetadataInVector(metadataKey, metadata);
|
|
161
|
+
return destroy;
|
|
162
|
+
}, [metadataKey, metadata]);
|
|
163
|
+
}
|
|
164
|
+
useFollowMetadataInSingle(metadataKey, metadata) {
|
|
165
|
+
(0, react_1.useEffect)(() => {
|
|
166
|
+
const destroy = this.defineMetadataInSingle(metadataKey, metadata);
|
|
167
|
+
return destroy;
|
|
168
|
+
}, [metadataKey, metadata]);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
exports.MetadataManager = MetadataManager;
|