You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## This PR
- adds `setProviderAndWait` example on the server readme
- adds `setProviderAndWait` example on the client readme
- fixed invalid link on the server readme
### Related Issues
Fixes#613
### Notes
The React SDK wasn't updated in this PR.
Signed-off-by: Michael Beemer <[email protected]>
---------
Signed-off-by: Michael Beemer <[email protected]>
Signed-off-by: Todd Baert <[email protected]>
Co-authored-by: Todd Baert <[email protected]>
To register a provider in a synchronous manner, you can use the `setProvider` method as shown below:
124
+
113
125
```ts
114
-
OpenFeature.setProvider(newMyProvider())
126
+
OpenFeature.setProvider(newMyProvider());
115
127
```
116
128
129
+
Once the provider has been registered, the status can be tracked using [events](#eventing).
130
+
117
131
In some situations, it may be beneficial to register multiple providers in the same application.
118
132
This is possible using [named clients](#named-clients), which is covered in more detail below.
119
133
@@ -131,22 +145,7 @@ sequenceDiagram
131
145
In (1) the Client sends a request to the provider backend in order to get all values from all feature flags that it has.
132
146
Once the provider backend replies (2) the client holds all flag values and therefore the flag evaluation process is synchronous.
133
147
134
-
In order to prevent flag evaluation to the default value while flags are still being fetched, it is highly recommended to only look for flag value after the provider has emitted the `Ready` event.
In order to prevent flag evaluations from defaulting while the provider is initializing, it is highly recommended to evaluate flags only after the provider is ready. This can be done using the `setProviderAndWait` method or using the `setProvider` method and listening for the `READY`[event](#eventing).
Named providers can be set in an awaitable or synchronous way.
229
+
For more details, please refer to the [providers](#providers) section.
230
+
214
231
### Eventing
215
232
216
233
Events allow you to react to state changes in the provider or underlying flag management system, such as flag definition changes, provider readiness, or error conditions.
0 commit comments