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

Ignore the write with proposedValue === undefined #11

Open
bmblb opened this issue May 25, 2020 · 2 comments
Open

Ignore the write with proposedValue === undefined #11

bmblb opened this issue May 25, 2020 · 2 comments

Comments

@bmblb
Copy link
Collaborator

bmblb commented May 25, 2020

Feels wrong to merge null and undefined values. undefined is smth that doesn't exist, null on the other hand is smth that exists, but doesn't have value.
This makes write(identifier, undefined) same as write(identifier, null). Latter is definitely user wanting to null the value. First doesn't make sense to call deliberately, rather a handy filter for undefined values - if undefined is passed then do nothing.

if (proposedValue === undefined) proposedValue = null

@bmblb
Copy link
Collaborator Author

bmblb commented May 25, 2020

Another implication: default values are ignored. Scheduling engine passes quite a few undefined values to engine, hoping that default value will be taken. Like lag. But it doesn't happen.

@canonic-epicure canonic-epicure changed the title undefined always turns to null Ignore the write with proposedValue === undefined May 25, 2020
@canonic-epicure
Copy link
Collaborator

Currently by design, for the scenario:

const someObject = {}
// lets say at this point `entity.someField` === 10
entity.someField = someObject.someField // undefiend

entity.someField === ??

User expectation is probably that entity.someField is "nullyfied" somehow, either to undefined or null (since graph does not contain undefined)

Need more feedback to proceed with such change.

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

2 participants