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

When multiple property changes provoke a single change method, arguments to that method are incorrect #321

Closed
sorvell opened this issue Oct 16, 2013 · 4 comments
Assignees

Comments

@sorvell
Copy link
Contributor

sorvell commented Oct 16, 2013

Now that multiple property changes can provoke a single property change method call, the arguments to the property change method must include all the old and new values and probably also the names of the properties that have changed.

@ghost ghost assigned sorvell Oct 16, 2013
@sorvell
Copy link
Contributor Author

sorvell commented Oct 16, 2013

For example:

observe: {
  foo: 'invalidate',
  bar: 'invadliate'
},
// oldValue will be one of foo or bar but we need to pass both and should probably pass oldValues, newValues, and property names
invalidate: function(oldValue) {
}

@sorvell
Copy link
Contributor Author

sorvell commented Oct 17, 2013

@rafaelw We are currently using a single CompoundPathObserver (cpo) to watch properties. For the case shown above, it seems like we want a separate cpo to track this set of changes. Otherwise, the master cpo has to do significant work to pass along the right set of changes, work that cpo exists to do. wdyt?

@frankiefu was concerned that the cpo api (changeHandler(newValues, oldValues, changes, paths) ) is too cumbersome and that we want to sugar it somewhat. He wanted something like changeHandler(changes) where changes would be an object with changes[path].oldValue, changes[path].newValue, changes[path].changed.

@rafaelw
Copy link
Contributor

rafaelw commented Aug 14, 2014

I think the task here is to define what the callback API should do. I seriously doubt the solution requires more than one CompoundObserver

@sorvell sorvell added p2 and removed p1 labels Nov 6, 2014
@tjsavage tjsavage added the 0.5 label May 21, 2015
@sorvell sorvell removed the p2 label Jun 12, 2015
@tjsavage
Copy link
Contributor

Closing this issue due to age and the release of version 1 of Polymer - please feel free to re-open if this is incorrect.

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

3 participants