Skip to content

Commit

Permalink
Merge pull request #3 from KablamoOSS/ok/readme
Browse files Browse the repository at this point in the history
updating kff readme
  • Loading branch information
ojkelly committed Feb 7, 2019
2 parents 93d638e + 762b06f commit 0117edd
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions packages/kerosene-feature-flags/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,11 @@ import { flag } from "@kablamo/kerosene-feature-flag";

const flags = {
FEATURE123: flag(c => [
c.condition("environment").must.not.any.of(["development", "staging"]),
c.condition("group").must.not.be.exactly("beta"),
c.condition("environment").must.be.any.of(["development", "staging"]),
c.condition("group").must.be.exactly("users"),
]),
FEATURE42: flag(c => [
c
.condition("environment")
.must.not.be.any.of(["development", "staging"]),
c.condition("environment").must.be.exactly("production"),
c.condition("group").must.be.exactly("beta"),
]),
};
Expand All @@ -41,7 +39,14 @@ if (flags.FEATURE123(runtime)) {
} else {
console.log("Old feature");
}

// output:
// New feature

if (flags.FEATURE42(runtime)) {
console.log("New feature");
} else {
console.log("Old feature");
}
// output:
// Old feature
```

0 comments on commit 0117edd

Please sign in to comment.