* 获取一个组件实例
()
| 34 | * 获取一个组件实例 |
| 35 | */ |
| 36 | acquire(): T { |
| 37 | this.stats.totalAcquired++; |
| 38 | |
| 39 | if (this.pool.length > 0) { |
| 40 | return this.pool.pop()!; |
| 41 | } |
| 42 | |
| 43 | this.stats.totalCreated++; |
| 44 | |
| 45 | return this.createFn(); |
| 46 | } |
| 47 | |
| 48 | /** |
| 49 | * 释放一个组件实例回池中 |
no test coverage detected