-
Notifications
You must be signed in to change notification settings - Fork 26
Description
Semantically equivalent states should be represented in the same way, no matter which way we reached the state. This is to avoid bugs due to subtle dependencies on the representation.
Examples:
- If a group member has never been set, it is missing in the group's JSON object.
After setting and retracting it, there is a member with valueundefined.
Retracting should actually remove the group member. - The same holds for a selection
$detail.
Retractions need to be propagated upwards. For example, empty groups objects must be replaced with undefined.
Implementation note: Retractions are implemented as updateTo(undefined). To fulfill this ticket, many implementations of updateTo would have to treat an argument of undefined specially. Perhaps it is is a simpler/cleaner approach to have a specialized retract method in the context.
(Alternatively, we might use the representation with explicitly undefined components as the canonical representation. This would however require to "expand" state subtrees eagerly.)