-
Notifications
You must be signed in to change notification settings - Fork 37
[FEATURE] export useOpenFeatureClientStatus #1036
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
Comments
Hey @literalpie, would the |
No, I'm checking for NOT_READY because I want to defer rendering of my feature flagged component until the loading state is finished (and I want to treat the error state fallback the same as ready) It's simple enough to replicate the hook. I just opened the issue in case it's an oversight. |
Maybe I'm confused, but what you're describing is the intended purposed of the |
useWhenProviderReady will return false if the status is ERROR or FATAL, or whatever. I want to treat that as true. |
Ah, I see. Ya in that case I can see the value. I think it would be nice to export this, but in that case I'd like it to have the behavior and features of or other public hooks (suspense, re-rendering, etc), like this. Does that make sense to you @literalpie ? That way our hooks have consistent features and options. I can update the issue, and I'm happy to assign it to you if you'd like to work on it (no pressure though). |
Sorry, I don't think I'll find time to work on this in the near term. I'm also not sure I understand what you mean by "re-rendering" from other public hooks. Because this hook sets a "useState" state when the events happen, I think it will cause re-rendering as much as needed. Also, because this hook is only getting the status of the client, and not doing any asynchronous work, I'm not sure suspense would be used. (but I rarely use suspense, so maybe I just don't understand right) |
<!-- Please use this template for your pull request. --> <!-- Please use the sections that you need and delete other sections --> ## This PR <!-- add the description of the PR here --> exposes the internal open feature client status hook so developers can act on non-ready resolved states ### Related Issues <!-- add here the GitHub issue that this PR resolves if applicable --> Fixes #1036 ### Notes <!-- any additional notes for this PR --> ### Follow-up Tasks <!-- anything that is related to this PR but not done here should be noted under this section --> <!-- if there is a need for a new issue, please link it here --> ### How to test <!-- if applicable, add testing instructions under this section --> --------- Signed-off-by: William Chou <[email protected]> Signed-off-by: Will Chou <[email protected]> Co-authored-by: Lukas Reining <[email protected]>
Requirements
the hook in use-open-feature-client-status.ts would be useful, but is not exported. I'm not sure if this is intentional or not?
The text was updated successfully, but these errors were encountered: