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

reading an computed property in a compute makes the binding on the compute not the map #30

Open
JaneOri opened this issue Feb 16, 2017 · 0 comments
Labels

Comments

@JaneOri
Copy link

JaneOri commented Feb 16, 2017

This causes problems because the events aren't forwarded to the map, which makes it so listening to change can never see those events.

var Type = can.Map.extend({
  define: {
    prop: {
      set: function(newVal){ return newVal; }
      get: function(lastSet){ return lastSet; },
      serialize: true
    }
  }
});

var t = new Type({prop: true})

var c = can.compute(function(){
  return t.attr("prop");
})

t.bind("change", function(){
  console.log("CHANGE EVENT");
});

t.attr("prop", false); //-> NOTHING logged

c.bind("change", function(){})

t.attr("prop", true); //-> NOTHING logged

t.bind("prop",function(){})

t.attr("prop", false); //-> CHANGE EVENT logged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants