(...fns: ((...args: any) => any)[])
| 3 | // 存储卸载时调用的钩子函数;unhook 后置为 null |
| 4 | private unhooks: (() => void)[] | null = []; |
| 5 | public append(...fns: ((...args: any) => any)[]) { |
| 6 | // 已经 unhook 的情况下保持幂等,直接忽略追加 |
| 7 | this.unhooks?.push(...fns); |
| 8 | } |
| 9 | public readonly unhook = () => { |
| 10 | // 已经 unhook 过则保持幂等 |
| 11 | this.isMounted = false; |
no test coverage detected