can.keys
Event fired when a property is added.
handler(event)
Handlers registered on can.keys
events will be called
back as follows.
import {DefineMap} from "can";
const person = new DefineMap({name: "Justin"});
person.on("can.keys", (event) => {
console.log(event.target.serialize()); //-> {name: "Justin", age: 33}
});
person.set("age", 33);
Use canReflect.onPatches() to know which property changed.
Parameters
- event
{Event}
:An event object.