()
| 790 | } |
| 791 | |
| 792 | remove() { |
| 793 | this.state = NodeState.removed |
| 794 | this.listeners.clear() |
| 795 | |
| 796 | if (this.lifetime === undefined) { |
| 797 | return |
| 798 | } |
| 799 | |
| 800 | this.disposeLifetime() |
| 801 | |
| 802 | if (this.previousParents === undefined) { |
| 803 | return |
| 804 | } |
| 805 | |
| 806 | const parents = this.previousParents |
| 807 | this.previousParents = undefined |
| 808 | for (const parent of parents) { |
| 809 | parent.removeChild(this) |
| 810 | if (parent.canBeRemoved) { |
| 811 | this.registry.removeNode(parent) |
| 812 | } |
| 813 | } |
| 814 | } |
| 815 | |
| 816 | subscribe(listener: () => void): () => void { |
| 817 | this.listeners.add(listener) |
no test coverage detected