-
-
Notifications
You must be signed in to change notification settings - Fork 202
[Documentation] Document the 'undefined' sentinel value for reactive config initialization #9287
Description
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.