canjs / can-map-define

Define rich attribute behavior
https://canjs.com/doc/can-map-define.html
MIT License
3 stars 2 forks source link

props with value functions get added to constructor defaults #27

Closed mickmcgrath13 closed 7 years ago

mickmcgrath13 commented 7 years ago
var MyMap = CanMap.extend({
  define: {
    propA: {
      value(){
        return 1;
      }
    }
  }
});

var map = new MyMap();

With this code, MyMap will now have 'propA' on its defaults

(can 2.3-legacy issue: https://github.com/canjs/canjs/issues/3057)