We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
We would like to report in the UI a dynamic list of all flags used Currently we'd need to do something along the lines of
const testEnabled= useFlag('rmm-test') const test2Enabled= useFlag('rmm-test2) const test3Enabled= useFlag('rmm-test3)
And im not sure its possibly to iterate through an array and dynamically make hooks.
whereas ideally it'd be good to return an array or record of key value pairs
const allFlags = useFlags() // {rmm-test1:true,...}
It appears
const client = useUnleashClient() const a = client.getAllToggles()
does something similar so perhaps the hook can just call getAllToggles
getAllToggles
No response
The text was updated successfully, but these errors were encountered:
For disabled toggles we will need Unleash/unleash-proxy#97
Sorry, something went wrong.
Yeah a convenience like this with any checks/types etc would be good:
import { useUnleashClient } from '@unleash/proxy-client-react'; export const useFlags = () => { const client = useUnleashClient(); return { getFlags: () => client.getAllToggles(), }; };
ac35a1a
Successfully merging a pull request may close this issue.
Describe the feature request
Describe the feature request
We would like to report in the UI a dynamic list of all flags used
Currently we'd need to do something along the lines of
Background
And im not sure its possibly to iterate through an array and dynamically make hooks.
Solution suggestions
whereas ideally it'd be good to return an array or record of key value pairs
It appears
does something similar so perhaps the hook can just call
getAllToggles
Background
No response
Solution suggestions
No response
The text was updated successfully, but these errors were encountered: