@ciscospark/common-evented

Class property decorator the adds change events to properties

Stats

stars šŸŒŸissues āš ļøupdated šŸ› created šŸ£size šŸ‹ļøā€ā™€ļø
@ciscospark/common-evented
Minified + gzip package size for @ciscospark/common-evented in KB

Readme

@ciscospark/common-evented

standard-readme compliant

Class property decorator the adds change events to properties

Install

npm install --save @ciscospark/common-evented

Usage


const evented = require(`@ciscospark/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;

Maintainers

This package is maintained by Cisco Webex for Developers.

Contribute

Pull requests welcome. Please see CONTRIBUTING.md for more details.

License

Ā© 2016-2018 Cisco and/or its affiliates. All Rights Reserved.

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.