Getters and Setters aren't enough. To make this happen you also need to know when a property is added or removed from the map, and getters/setters are only for existing properties. In ES6 (the next version of JavaScript) there will be an Object.observe which will enable this type of behavior. Currently it's not available even in bleeding-edge browsers, so unfortunately we are going to have to wait. But not to worry, this is definitely something CanJS will have in the future.
↧