Skip to content

Commit

Permalink
Using destructuring
Browse files Browse the repository at this point in the history
  • Loading branch information
mileszim committed Feb 23, 2016
1 parent 961cfcb commit ab7fd3c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions addon/computed.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import Ember from 'ember';

const { get, set } = Ember;

export default {
ability: function(type, resourceName) {
if (arguments.length === 1) {
Expand All @@ -11,8 +13,8 @@ export default {

Ember.assert("No ability class found for " + type, ability);

const resource = Ember.get(this, resourceName);
Ember.set(ability, "model", resource);
const resource = get(this, resourceName);
set(ability, "model", resource);
return ability;
});
}
Expand Down

0 comments on commit ab7fd3c

Please sign in to comment.