* Child nodes mutate the `projection` state of their parent node as they're being projected. * This function resets the `project` back to its initial state. * @param tNode
(tNode: TElementNode)
| 394 | * @param tNode |
| 395 | */ |
| 396 | function resetProjectionState(tNode: TElementNode): void { |
| 397 | // The `projection` is mutated by child nodes as they're being projected. We need to |
| 398 | // reset it to the initial state so projection works after the template is swapped out. |
| 399 | if (tNode.projection !== null) { |
| 400 | for (const current of tNode.projection) { |
| 401 | if (isTNodeShape(current)) { |
| 402 | // Reset `projectionNext` since it can affect the traversal order during projection. |
| 403 | current.projectionNext = null; |
| 404 | current.flags &= ~TNodeFlags.isProjected; |
| 405 | } |
| 406 | } |
| 407 | tNode.projection = null; |
| 408 | } |
| 409 | } |
no test coverage detected
searching dependent graphs…