@cc-component/cc-core 1.8.2 → 1.8.3

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.
@@ -267,7 +267,7 @@ export class EffectSingleCase {
267
267
  }
268
268
  }
269
269
 
270
- /**获取节点 */
270
+ /**获取节点-同步 */
271
271
  getNode(params: IPoolParams): Node {
272
272
  const name = params.path.split(':').pop();
273
273
  var np = this.effects.get(name);
@@ -276,6 +276,19 @@ export class EffectSingleCase {
276
276
  return node
277
277
  }
278
278
 
279
+ /**获取节点-异步 */
280
+ async loadNode(params: IPoolParams): Promise<Node> {
281
+ let node = this.getNode(params)
282
+ if (!node || (node && !node.isValid)) {
283
+ if ((node && !node.isValid)) {
284
+ Logger.debug('节点已销毁,请检测业务逻辑。节点没有进行回收就销毁了界面', params.path)
285
+ }
286
+ node = await App.pool.load(params)
287
+ }
288
+ this.updateNode(node, params)
289
+ return node
290
+ }
291
+
279
292
  /** 加载节点对象 */
280
293
  load(params: IPoolParams): Promise<Node> {
281
294
  return new Promise(async (resolve, reject) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cc-component/cc-core",
3
- "version": "1.8.2",
3
+ "version": "1.8.3",
4
4
  "engine": ">=3.8.6",
5
5
  "description": "系统组件添加常用扩展方法",
6
6
  "main": "index.ts",