Skip to content

Commit

Permalink
Merge pull request #14 from achambers/send-key-when-flag-unknown
Browse files Browse the repository at this point in the history
Pass flag key as default value
  • Loading branch information
achambers authored Sep 28, 2017
2 parents ea822bb + a3d7cfb commit 01ab9ba
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions addon/services/launch-darkly-remote.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,10 @@ export default Service.extend({
},

variation(key) {
let value = this.get('_client').variation(key, NON_EXISTANT_FLAG_VALUE);
let nonExistantFlagValue = `${NON_EXISTANT_FLAG_VALUE}: ${key}`;
let value = this.get('_client').variation(key, nonExistantFlagValue);

if (value === NON_EXISTANT_FLAG_VALUE) {
if (value === nonExistantFlagValue) {
warn(`Feature flag with key '${key}' has not been defined. Returning default value of '${DEFAULT_FLAG_VALUE}'`, false, { id: 'ember-launch-darkly.feature-flag-not-defined' });

return DEFAULT_FLAG_VALUE;
Expand Down

0 comments on commit 01ab9ba

Please sign in to comment.