mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-25 09:03:12 +03:00
14 lines
351 B
JavaScript
14 lines
351 B
JavaScript
|
import Helper from '@ember/component/helper';
|
||
|
import {inject as service} from '@ember/service';
|
||
|
|
||
|
export default class ToggleFeature extends Helper {
|
||
|
@service feature;
|
||
|
|
||
|
compute([featureFlag]) {
|
||
|
return () => {
|
||
|
const flag = !!this.feature.get(featureFlag);
|
||
|
this.feature.set(featureFlag, !flag);
|
||
|
};
|
||
|
}
|
||
|
}
|