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

Model architecture: Allow traits in strata to be null #3375

Open
kring opened this issue May 8, 2019 · 1 comment
Open

Model architecture: Allow traits in strata to be null #3375

kring opened this issue May 8, 2019 · 1 comment

Comments

@kring
Copy link
Member

kring commented May 8, 2019

Any trait in a stratum should be allowed to have the value null. It means "even if a strata below me has provided a value for this trait, make the value undefined". It is also used to mark removal of things from lists. For example:

{
  "info": [
    {
      "name": "Service Description",
      "content": null
    }
  ]
}

means "remove the info section with the name Service Description".

This is currently done in an ad-hoc fashion with the isNullable property of @primitiveTrait, but it should be allowed everywhere.

Note that the flattened and Model views of traits should never have the value null. If a trait has no value, either because one was never given or because it was removed by a stratum, then that trait's value will be undefined.

@kring kring added the Version 8 formerly MobX label May 8, 2019
@mgcsls mgcsls self-assigned this Jan 13, 2020
@soyarsauce
Copy link
Contributor

isRemoval also currently exists for this

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

No branches or pull requests

5 participants