Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4830

Dereferencing/Destructuring Ember Global... Best Practice?

$
0
0

@OakBehringer wrote:

In regards to preparing for a world without the Ember global, which would be considered "the right way" to do this?

import Ember from 'ember';
const { computed } = Ember;
const { alias, reads } = Computed

export default Ember.Component.extend({
  prop1: alias('some.thing'),
  prop2: reads('other.thing'),
  prop3: computed('coolbeans', function() { ...

Or

import Ember from 'ember';
const { computed } = Ember;

export default Ember.Component.extend({
  prop1: computed.alias('some.thing'),
  prop2: computed.reads('other.thing'),
  prop3: computed('coolbeans', function() { ...

(The difference is using computed.alias, computed.reads vs destructuring all the way down to alias and reads).

Thanks!
Adam

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4830

Trending Articles