can-simple-map
A performant live-bound map.
new SimpleMap([props])
Creates a new instance of can.SimpleMap.
Parameters
- props
{Object}
:Properties and values to seed the Observe with.
Returns
{can.SimpleMap}
:
An instance of can.SimpleMap
with the properties from props.
SimpleMap.extend([name,] [staticProperties,] instanceProperties)
Creates a new extended constructor function.
Use
SimpleMap
provides a way to create an Observable whose properties can be changed using attr.
var map = new SimpleMap({ age: 29 });
map.on('age', function(ev, newVal, oldVal) {
newVal; // 30
oldVal; // 29
});
foo.attr('age'); // 29
map.attr('age', 30);