@ember-decorators/auto-computed

The default blueprint for ember-cli addons.

Stats

stars 🌟issues ⚠️updated 🛠created 🐣size 🏋️‍♀️
33Jan 2, 2019Oct 27, 2017Minified + gzip package size for @ember-decorators/auto-computed in KB

Readme

@ember-decorators/auto-computed

Note: If you are using getter and setter functions (the recommended way), please use the @computed key from ember-decorators

Installation

ember install @ember-decorators/auto-computed

If you're using @ember-decorators/auto-computed in an addon, pass the -S option to save this as a dependency as opposed to the default devDependency:

ember install -S @ember-decorators/auto-computed

Application Usage

In your application where you would normally have:

import Ember from 'ember';

export default Ember.Component.extend({
  bar: Ember.computed('someKey', 'otherKey', function() {
    var someKey = this.get('someKey');
    var otherKey = this.get('otherKey');

    return `${someKey} - ${otherKey}`;
  })
})

You replace it with this:

import Component from '@ember/component';
import autoComputed from '@ember-decorators/auto-computed';

export default class ExampleComponent extends Component {
  @autoComputed('someKey', 'otherKey')
  bar(someKey, otherKey) {
    return `${someKey} - ${otherKey}`;
  }
}

Note: The @autoComputed decorator wraps ember-macro-helpers which provides a lot of helpful features on top of standard computeds. It is highly recommended that you read the documentation for that addon as well.

Installation

  • git clone <repository-url> this repository
  • cd @ember-decorators/auto-computed
  • yarn install

Running

Running Tests

  • yarn test (Runs ember try:each to test your addon against multiple Ember versions)
  • ember test
  • ember test --server

Building

  • ember build

For more information on using ember-cli, visit https://ember-cli.com/.

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.