ember-decorators / ember-decorators/auto-computed
Feature Request: Allow composition of computed decorators
- Dominant language
- JavaScript
- Stars
- 3
- Forks
- 3
- PR merge metrics
- No merged PRs in 30d
Description
For feature parity with ember-macro-helpers and ember-awesome-macros.
This works:
```javascript
import EmberObject from 'ember-object';
import or from 'ember-awesome-macros/or';
import computed from 'ember-macro-helpers/computed';
export default EmberObject.extend({
foo: computed(or('bar', 'qux'), function(barOrQux) {
})
});
```
This, sadly, does not:
```javascript
import EmberObject from 'ember-object';
import computed, { or } from 'ember-computed-decorators';
export default EmberObject.extend({
@computed @or('bar', 'qux') // or @computed(or(..))
foo(barOrQux) {
}
});
```
This works (with kellyselden/ember-awesome-macros#348):
```javascript
import EmberObject from 'ember-object';
import mapBy from 'ember-awesome-macros/array/map-by';
import sum from 'ember-awesome-macros/sum';
import raw from 'ember-macro-helpers/raw';
export default EmberObject.extend({
items: [],
totalQuantity: sum(mapBy('items', raw('quantity')))
});
```
This, sadly, does not:
```javascript
import EmberObject from 'ember-object';
import { mapBy, sum } from 'ember-computed-decorators';
export default EmberObject.extend({
items: [],
@sum @mapBy('items', 'quantity') // or @sum(mapBy(..))
totalQuantity
});
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.