这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@bartvanremortele
Copy link

This fixes #26

newValue instanceof DefaultValue
) {
delete state[node.key]
if (state.hasOwnProperty(node.key)) delete state[node.key]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like these two construction are the same:

if (a && b) {
}

and

if (a) {
   if (b) {
   }
}

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are not the same. If the state does not contain the node.key it will still persist the DefaultValue object because then it will fall in the else branch.

@polemius polemius force-pushed the master branch 2 times, most recently from 050c87f to 2f70d34 Compare May 17, 2023 06:56
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

Successfully merging this pull request may close these issues.

Reseting atom causes key to be empty instead of default value

2 participants