Skip to content

Commit

Permalink
Replace computed.volatile with native getter
Browse files Browse the repository at this point in the history
  • Loading branch information
pgengler committed May 27, 2019
1 parent 0b4ec04 commit 538f0c4
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions addon/services/features.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
/*eslint-disable no-extra-boolean-cast, no-console */
import Service from '@ember/service';
import { camelize } from '@ember/string';
import { computed } from '@ember/object';

export default Service.extend({
const FeaturesService = Service.extend({

init() {
this._super(...arguments);
Expand Down Expand Up @@ -47,10 +46,6 @@ export default Service.extend({
return isEnabled;
},

flags: computed(function () {
return Object.keys(this._flags);
}).volatile(),

_resetFlags() {
this._flags = Object.create(null);
},
Expand All @@ -77,5 +72,12 @@ export default Service.extend({
unknownProperty(key) {
return this.isEnabled(key);
}
});

Object.defineProperty(FeaturesService.prototype, 'flags', {
get() {
return Object.keys(this._flags);
}
});

export default FeaturesService;

0 comments on commit 538f0c4

Please sign in to comment.