-
Notifications
You must be signed in to change notification settings - Fork 39
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
docs: Use SetProviderAndWait
in README
#332
Conversation
SetProviderAndWait
in README docsSetProviderAndWait
in README
Signed-off-by: Nicholas Thomson <RedbackThomson@users.noreply.github.com>
2e5686a
to
5075e80
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #332 +/- ##
=======================================
Coverage 88.13% 88.13%
=======================================
Files 14 14
Lines 1408 1408
=======================================
Hits 1241 1241
Misses 143 143
Partials 24 24
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Both ways are valid but I agree that SetProviderAndWait
is likely better in most example. Thanks for the PR.
My team just spent a day trying to find the flake in our unit tests, which I figured out was coming from not using the wait version. I figure people don't realise the |
Ah, sorry about that! FYI @toddbaert @lukas-reining @thomaspoignant |
@RedbackThomson could you please update the basic example at the top as well? |
Ya we should try to emphasize this in general as the "default" way. There's lots of cases where setting the provider asynchronously is valid (event-based frameworks such as React come to mind) but for demos and basic use cases the blocking version is much better. |
Sorry @RedbackThomson, I merged too soon. Feel free to open a separate PR. |
This PR
There is a discrepancy between the default provider registration function in the docs on openfeature.dev and in the
README
of this repository. SinceSetProvider
is async, it makes more sense to default to usingSetProviderAndWait
in all documentation uniformly.README
to useSetProviderAndWait
as the default registration functionRelated Issues
Fixes N/A
Notes
Follow-up Tasks
How to test