-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flag initialisation #948
Flag initialisation #948
Conversation
abfaa05
to
be49932
Compare
packages/cozy-flags/src/flag.js
Outdated
* Enables a list of flags | ||
* | ||
* Supports passing either | ||
* - an array containing flag names (in this case, flag values will be true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Je trouve les deux prototypes trop différents.
J'aurais compris :
- soit un nom soit une liste de noms
- soit un objet nom/valeur soit un tableau d'objet nom/valeur
Là tu croises les possibilités et ça me gêne. Ca mérite probablement deux fonctions séparées
|
||
const store = new FlagStore() | ||
export const getTemplateData = attr => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cette fonction est toujours là pour les flags, pourquoi ne pas fixer la valeur à "flags" ? A-t-on besoin du paramétrage ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Je vois pas l'avantage de rigidifier getTemplateData alors qu'en l'état elle fonctionne et est flexible.
Flags are initialized from nodes with cozy-flags or cozy-data
57bd0da
to
1424a5b
Compare
Co-Authored-By: Éric D. <15271+edas@users.noreply.github.com>
ef217ef
to
85000f5
Compare
cozy-flags
now supports initialisation eitherA CozyClient plugin can be attached to a CozyClient instance for
automatic initialisation and reset of flags on login/logout.
New APIs
async flags.initialise()
: initialises flags from DOM or remote (remote only if DOM not possible)client.registerPlugin(flags.plugin)