Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Canonical state representation #2

Open
hcschuetz opened this issue May 16, 2015 · 0 comments
Open

Canonical state representation #2

hcschuetz opened this issue May 16, 2015 · 0 comments

Comments

@hcschuetz
Copy link
Member

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 value undefined.
    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.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant