Skip to content

[Documentation] Document the 'undefined' sentinel value for reactive config initialization #9287

@tobiu

Description

@tobiu

Context
The Neo.mjs config system relies on an elegant and highly performant architectural pattern for reactive configs: undefined acts as a strict, immutable sentinel value representing "initial instantiation".

The Problem
If a developer is unaware of this, they might try to reset a config to undefined during the component's lifecycle. Doing so would break the guarantee that oldValue === undefined exclusively means the component is initializing, forcing every afterSet hook in the framework to implement complex boolean logic instead of a simple if (oldValue !== undefined) check.

The Solution
Update the JSDoc for static config in src/core/Base.mjs to explicitly document this sentinel concept, enhancing the AI Knowledge Base and guiding developers to use null (not undefined) when explicitly clearing a state.

Metadata

Metadata

Assignees

Labels

aicoreCore framework functionalitydocumentationImprovements or additions to documentation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions