@ives_xxz/framework 1.1.5 → 1.1.6
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 +2 -1
- package/manager/FWSocketManager.ts +2 -2
- package/package.json +1 -1
- package/service/socket/FWSocket.ts +5 -3
package/FW.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export default class FWSocketManager extends FWManager implements FW.SocketManag
|
|
|
13
13
|
public initialize(): void {
|
|
14
14
|
this.socketMap = new Map<string, FW.Socket>();
|
|
15
15
|
}
|
|
16
|
-
public onDestroy(): void {}
|
|
16
|
+
public onDestroy(): void { }
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* 创建一个socket
|
|
@@ -39,7 +39,7 @@ export default class FWSocketManager extends FWManager implements FW.SocketManag
|
|
|
39
39
|
});
|
|
40
40
|
this.socketMap.set(tag, proxy.socket);
|
|
41
41
|
|
|
42
|
-
await proxy.promise
|
|
42
|
+
await proxy.promise;
|
|
43
43
|
|
|
44
44
|
return proxy.socket;
|
|
45
45
|
}
|
package/package.json
CHANGED
|
@@ -101,12 +101,14 @@ export default class FWSocket implements FW.Socket {
|
|
|
101
101
|
|
|
102
102
|
this.promiseProxy = {
|
|
103
103
|
promise: undefined,
|
|
104
|
+
resolve: undefined,
|
|
104
105
|
socket: this,
|
|
105
106
|
};
|
|
106
107
|
|
|
107
|
-
new Promise<
|
|
108
|
-
this.promiseProxy.
|
|
108
|
+
this.promiseProxy.promise = new Promise<FW.Socket>((resolve) => {
|
|
109
|
+
this.promiseProxy.resolve = resolve;
|
|
109
110
|
});
|
|
111
|
+
|
|
110
112
|
return this.promiseProxy;
|
|
111
113
|
}
|
|
112
114
|
/**
|
|
@@ -206,7 +208,7 @@ export default class FWSocket implements FW.Socket {
|
|
|
206
208
|
this.isReconnect = false;
|
|
207
209
|
this.handle?.onOpen?.();
|
|
208
210
|
this.heartHandle();
|
|
209
|
-
this.promiseProxy?.
|
|
211
|
+
this.promiseProxy?.resolve(this);
|
|
210
212
|
}
|
|
211
213
|
|
|
212
214
|
private heartHandle() {
|