feat(core): set kind field on template and effect nodes (#58865)

Builds on #58333 by assigning the kind field to reactive nodes that are not in the `core/primitives` package.

PR Close #58865
This commit is contained in:
AleksanderBodurri 2024-11-25 01:46:19 -05:00 committed by Pawel Kozlowski
parent 8d6ea5bae3
commit e894a5daea
2 changed files with 3 additions and 0 deletions

View file

@ -51,6 +51,7 @@ export function maybeReturnReactiveLViewConsumer(consumer: ReactiveLViewConsumer
const REACTIVE_LVIEW_CONSUMER_NODE: Omit<ReactiveLViewConsumer, 'lView'> = {
...REACTIVE_NODE,
consumerIsAlwaysLive: true,
kind: 'template',
consumerMarkedDirty: (node: ReactiveLViewConsumer) => {
markAncestorsForTraversal(node.lView!);
},
@ -80,6 +81,7 @@ export function getOrCreateTemporaryConsumer(lView: LView): ReactiveLViewConsume
const TEMPORARY_CONSUMER_NODE = {
...REACTIVE_NODE,
consumerIsAlwaysLive: true,
kind: 'template',
consumerMarkedDirty: (node: ReactiveLViewConsumer) => {
let parent = getLViewParent(node.lView!);
while (parent && !viewShouldHaveReactiveConsumer(parent[TVIEW])) {

View file

@ -245,6 +245,7 @@ export const BASE_EFFECT_NODE: Omit<EffectNode, 'fn' | 'destroy' | 'injector' |
hasRun: false,
cleanupFns: undefined,
zone: null,
kind: 'effect',
onDestroyFn: noop,
run(this: EffectNode): void {
this.dirty = false;