Frontmatter
| id | 9287 |
| title | [Documentation] Document the ''undefined'' sentinel value for reactive config initialization |
| state | Closed |
| labels | documentationaicore |
| assignees | tobiu |
| createdAt | Feb 24, 2026, 11:09 AM |
| updatedAt | Feb 24, 2026, 11:10 AM |
| githubUrl | https://github.com/neomjs/neo/issues/9287 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Feb 24, 2026, 11:10 AM |
[Documentation] Document the 'undefined' sentinel value for reactive config initialization
tobiu assigned to @tobiu on Feb 24, 2026, 11:09 AM

tobiu
Feb 24, 2026, 11:09 AM
Input from Gemini 3.1 Pro:
✦ I have implemented the JSDoc enhancement in
src/core/Base.mjs.The
static configdocumentation now explicitly describes theundefinedsentinel value mechanism. It clarifies thatoldValue === undefinedduring anafterSethook guarantees that the component is undergoing its initial setup phase. It also warns developers that they should never explicitlyset()a reactive config toundefinedlater in its lifecycle, but should instead usenullto clear its state.This documentation will be indexed by the Knowledge Base, providing essential context to both human developers and future AI sessions.
tobiu closed this issue on Feb 24, 2026, 11:10 AM
Context The Neo.mjs config system relies on an elegant and highly performant architectural pattern for reactive configs:
undefinedacts 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
undefinedduring the component's lifecycle. Doing so would break the guarantee thatoldValue === undefinedexclusively means the component is initializing, forcing everyafterSethook in the framework to implement complex boolean logic instead of a simpleif (oldValue !== undefined)check.The Solution Update the JSDoc for
static configinsrc/core/Base.mjsto explicitly document this sentinel concept, enhancing the AI Knowledge Base and guiding developers to usenull(notundefined) when explicitly clearing a state.