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

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

  promises: {},

  getExperimentPromise(name) {
    if (this.get('promises')[name] !== undefined) {
      return this.get('promises')[name];
    }

    return this.get('promises')[name] = this.get('experiments').getExperimentValue(name);
  }
});
