propertyName
Event fired when a property on the map changes values.
handler(event, newValue, oldValue)
Handlers registered on propertyName
events will be called
back as follows.
import {DefineMap} from "can";
const person = new DefineMap({name: "Justin"});
person.on("name", (event, newVal, oldVal) => {
console.log( newVal ); //-> "Brian"
console.log( oldVal ); //-> "Justin"
});
person.set("name", "Brian");
Parameters
- event
{Event}
:An event object.
- newVal
{*}
:The new value of the
propertyName
property. - oldVal
{*}
:The old value of the
propertyName
property.