@ives_xxz/framework 1.1.4 → 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 CHANGED
@@ -214,7 +214,8 @@ declare namespace FW {
214
214
  };
215
215
 
216
216
  type SocketPromiseProxy = {
217
- promise: Function;
217
+ promise: Promise<FW.Socket>;
218
+ resolve: Function;
218
219
  socket: FW.Socket;
219
220
  };
220
221
 
@@ -221,14 +221,15 @@ export default class FWHotUpdateManager extends FWManager implements FW.HotUpdat
221
221
  FWLog.debug('热更新中结果 needRestart -> ', needRestart);
222
222
  FWLog.debug('下载完成');
223
223
  this.assetMgr.setEventCallback(null!);
224
- this.assetMgr = null;
225
- this.isRetry = false;
226
- this.isUpdate = false;
227
224
  var searchPaths = jsb.fileUtils.getSearchPaths();
228
225
  var newPaths = this.assetMgr.getLocalManifest().getSearchPaths();
229
226
  Array.prototype.unshift.apply(searchPaths, newPaths);
230
227
  jsb.fileUtils.setSearchPaths(searchPaths);
228
+ this.isRetry = false;
229
+ this.isUpdate = false;
230
+ this.assetMgr = null;
231
231
  this.listener.completedHandle?.(this.newVersion);
232
+
232
233
  }
233
234
  }
234
235
 
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ives_xxz/framework",
3
- "version": "1.1.4",
3
+ "version": "1.1.6",
4
4
  "description": "cocoscreator 2.x mvc framework",
5
5
  "main": "index.js",
6
6
  "keywords": [
@@ -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<FWSocket>((resolve) => {
108
- this.promiseProxy.promise = resolve;
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?.promise(this);
211
+ this.promiseProxy?.resolve(this);
210
212
  }
211
213
 
212
214
  private heartHandle() {