@ives_xxz/framework 1.3.3 → 1.3.5
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/FW.d.ts +1 -0
- package/Framework.ts +7 -4
- package/package.json +3 -5
package/FW.d.ts
CHANGED
package/Framework.ts
CHANGED
|
@@ -67,8 +67,6 @@ class Framework {
|
|
|
67
67
|
public getComponents<T>(serviceIdentifier: FW.ServiceIdentifier<T>): T[] {
|
|
68
68
|
const binder = (this.container as any)._bindingDictionary;
|
|
69
69
|
const map = binder._map;
|
|
70
|
-
|
|
71
|
-
// 获取所有可能的子类绑定
|
|
72
70
|
const childBindings: interfaces.Binding<T>[] = [];
|
|
73
71
|
for (const [key, bindings] of map.entries()) {
|
|
74
72
|
for (const binding of bindings) {
|
|
@@ -97,13 +95,15 @@ class Framework {
|
|
|
97
95
|
*/
|
|
98
96
|
register(data: FW.RegisterFramework) {
|
|
99
97
|
const classes = [data.logic, data.data, data.config, data.sender, data.handle];
|
|
100
|
-
|
|
98
|
+
FWLog.debug('framework注册->', classes);
|
|
101
99
|
classes.forEach((cls, index) => {
|
|
102
100
|
if (cls && !this.container.isBound(cls)) {
|
|
101
|
+
FWLog.debug('framework容器绑定成功->', cls);
|
|
103
102
|
this.container.bind(cls).toSelf().inSingletonScope();
|
|
104
103
|
this.container.bind(this.getKey(data.bundleName, index)).toService(cls);
|
|
105
104
|
}
|
|
106
105
|
});
|
|
106
|
+
FWLog.debug('framework注册完成->', this.container);
|
|
107
107
|
}
|
|
108
108
|
/**
|
|
109
109
|
* 注销数据
|
|
@@ -112,18 +112,21 @@ class Framework {
|
|
|
112
112
|
*/
|
|
113
113
|
unRegister(data: FW.RegisterFramework) {
|
|
114
114
|
const classes = [data.logic, data.data, data.config, data.sender, data.handle];
|
|
115
|
-
|
|
115
|
+
FWLog.debug('framework注销->', classes);
|
|
116
116
|
classes.forEach((cls, index) => {
|
|
117
117
|
const key = this.getKey(data.bundleName, index);
|
|
118
118
|
if (cls && this.container.isBound(cls)) {
|
|
119
119
|
this.container.get(key)['onDestroy']?.();
|
|
120
120
|
this.container.unbind(cls);
|
|
121
|
+
FWLog.debug('framework容器解开绑定->', cls);
|
|
121
122
|
}
|
|
122
123
|
if (this.container.isBound(key)) {
|
|
123
124
|
this.container.get(key)['onDestroy']?.();
|
|
124
125
|
this.container.unbind(this.getKey(data.bundleName, index));
|
|
126
|
+
FWLog.debug('framework容器解开绑定->', this.getKey(data.bundleName, index));
|
|
125
127
|
}
|
|
126
128
|
});
|
|
129
|
+
FWLog.debug('framework注销完成->', this.container);
|
|
127
130
|
}
|
|
128
131
|
|
|
129
132
|
private getKey(bundleName: string, tag: FWSystemDefine.FWBindTag) {
|
package/package.json
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ives_xxz/framework",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.5",
|
|
4
4
|
"description": "cocoscreator 2.x mvc framework",
|
|
5
5
|
"main": "index.js",
|
|
6
|
-
"keywords": [
|
|
7
|
-
"123456"
|
|
8
|
-
],
|
|
6
|
+
"keywords": ["123456"],
|
|
9
7
|
"author": "ives",
|
|
10
8
|
"license": "ISC"
|
|
11
|
-
}
|
|
9
|
+
}
|