import injectService from 'ember-service/inject';
import Service from 'ember-service';
import RSVP from 'rsvp';

export const EXPERIMENT_NAME = 'INTL_I18N';

export default Service.extend({
  experiments: injectService(),

  promise: null,

  init() {
    this._super(...arguments);

    this.set('promise', this.get('experiments').getExperimentValue(EXPERIMENT_NAME));
  },

  getExperimentPromise() {
    return this.get('promise') || RSVP.resolve('control');
  }
});
