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

Consider reseting property to default when binding undefined structured data #1946

Closed
kevinpschaaf opened this issue Jun 24, 2015 · 1 comment
Assignees

Comments

@kevinpschaaf
Copy link
Member

When binding structured data (e.g. {{item.type}}) to an element, if a new item is assigned that no longer has a sub-property where the previous object did (e.g. item goes from {name: 'foo', type: 'zaz'} to {name: 'bar'}, an undefined value will be pushed through the binding to the element. Since undefined has special meaning, especially for multi-property observers which are not called until all properties are defined, this can result in unexpected state.

See use case at #1742 and proposed fix in #1941

@kevinpschaaf kevinpschaaf self-assigned this Jun 24, 2015
kevinpschaaf added a commit that referenced this issue Jun 24, 2015
…1742

This takes advantage of the fact that single property observers are called for each change (including undefined), whereas multi-property observers wait for all properties to be defined.  Since the side-effect of the observe is to queue an async render, there is no real benefit from this being a multi-property observer.  #1946 is open to track a more general fix for this issue.
@kevinpschaaf
Copy link
Member Author

Closing, we likely won't pursue this gambit as a solution.

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

1 participant