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

Register live.attr computes as mutated key dependencies #70

Open
m-mujica opened this issue Nov 2, 2017 · 0 comments
Open

Register live.attr computes as mutated key dependencies #70

m-mujica opened this issue Nov 2, 2017 · 0 comments

Comments

@m-mujica
Copy link
Contributor

m-mujica commented Nov 2, 2017

can-view-mutate-dependencies API allows registering key dependencies easily.

.addMutatedBy(el, propName, { valueDependencies: new Set([compute]) });

We'll have to lift the call to .addMutatedBy from live.listen (or add the propertyName as an argument) since it currently is unaware of properties, it only takes the element and the compute.

listen: function(el, compute, change) {
return live.setup(
el,
function bind() {
canReflect.onValue(compute, change, "notify");
//compute.computeInstance.addEventListener('change', change);
//!steal-remove-start
mutateDeps.addMutatedBy(el, compute);
//!steal-remove-end
},
function unbind(data) {
canReflect.offValue(compute, change, "notify");
//!steal-remove-start
mutateDeps.deleteMutatedBy(el, compute);
//!steal-remove-end
//compute.computeInstance.removeEventListener('change', change);
if (data.nodeList) {
nodeLists.unregister(data.nodeList);
}
}
);
},

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

1 participant