Skip to content

Commit

Permalink
fix: Informations on readme
Browse files Browse the repository at this point in the history
Import of FlagSwitcher:
We could re-export from the index,
to match the current doc,
but that would cause a Breaking Change.
I don't know if it's really better

Condition of flag('switcher'):
The condition does not return `undefined`
but rather `null`
  • Loading branch information
Merkur39 committed Nov 24, 2021
1 parent 4accdb6 commit ea517de
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/cozy-flags/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,11 @@ The `FlagSwitcher` shows all flags in use and displays all
flags in use.

```js
import flag, { FlagSwitcher } from 'cozy-flags'
import flag from 'cozy-flags'
import FlagSwitcher from 'cozy-flags/dist/FlagSwitcher'

if (process.env.NODE_ENV !== 'production'
&& flag('switcher') === undefined) {
&& flag('switcher') === null) {
flag('switcher', true) // set default flag in dev mode
}

Expand Down

0 comments on commit ea517de

Please sign in to comment.