Class property decorator the adds change events to properties
npm install --save @webex/common-evented
const evented = require(`@webex/common-evented`);
const Events = require(`ampersand-events`);
class X extends Events {
@evented
prop = null;
}
const x = new X();
x.on(`change:prop`, () => {
console.log(x.prop);
// => 6
});
x.prop = 6;
This package is maintained by Cisco Webex for Developers.
Pull requests welcome. Please see CONTRIBUTING.md for more details.
© 2016-2020 Cisco and/or its affiliates. All Rights Reserved.