The vnodeInitialized property was incorrectly defined as a non-reactive config in Neo.component.Base and manually managed with getters, setters, and event firing. This created an inconsistent and fragile implementation.
This refactoring corrected the issue by:
- Moving the definition of
vnodeInitialized to the VdomLifecycle mixin, its logical owner.
- Converting it to a proper reactive config (
vnodeInitialized_) with a trailing underscore.
- Adding an
afterSetVnodeInitialized hook within the mixin to handle the vnodeInitialized event firing automatically.
- Removing the obsolete non-reactive config, getter, and setter from
Neo.component.Base.
- Updating
onInitVnode() and syncVnodeTree() to use the new reactive setter (this.vnodeInitialized = true) instead of manually manipulating the private property and firing events.
This change centralizes the logic, improves code clarity, and aligns the implementation with Neo.mjs best practices for reactive state management.
The
vnodeInitializedproperty was incorrectly defined as a non-reactive config inNeo.component.Baseand manually managed with getters, setters, and event firing. This created an inconsistent and fragile implementation.This refactoring corrected the issue by:
vnodeInitializedto theVdomLifecyclemixin, its logical owner.vnodeInitialized_) with a trailing underscore.afterSetVnodeInitializedhook within the mixin to handle thevnodeInitializedevent firing automatically.Neo.component.Base.onInitVnode()andsyncVnodeTree()to use the new reactive setter (this.vnodeInitialized = true) instead of manually manipulating the private property and firing events.This change centralizes the logic, improves code clarity, and aligns the implementation with Neo.mjs best practices for reactive state management.