Skip to content

Commit 8663344

Browse files
committed
Update README.md
1 parent 6a3d3ea commit 8663344

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

README.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,21 @@ argument containing the additional configuration options for
2121
the [ConfigCat Kotlin SDK](https://github.com/configcat/kotlin-sdk):
2222

2323
```kotlin
24-
// Configure the provider.
25-
val provider = ConfigCatProvider("<YOUR-CONFIGCAT-SDK-KEY>") {
26-
pollingMode = autoPoll { pollingInterval = 60.seconds }
27-
}
24+
coroutineScope.launch(Dispatchers.IO) {
25+
// Configure the provider.
26+
val provider = ConfigCatProvider("<YOUR-CONFIGCAT-SDK-KEY>") {
27+
pollingMode = autoPoll { pollingInterval = 60.seconds }
28+
}
2829

29-
// Configure the OpenFeature API with the ConfigCat provider.
30-
OpenFeatureAPI.setProviderAndWait(provider)
30+
// Configure the OpenFeature API with the ConfigCat provider.
31+
OpenFeatureAPI.setProviderAndWait(provider)
3132

32-
// Create a client.
33-
val client = OpenFeatureAPI.getClient()
33+
// Create a client.
34+
val client = OpenFeatureAPI.getClient()
3435

35-
// Evaluate feature flag.
36-
val isAwesomeFeatureEnabled = client.getBooleanDetails("isAwesomeFeatureEnabled", false)
36+
// Evaluate feature flag.
37+
val isAwesomeFeatureEnabled = client.getBooleanDetails("isAwesomeFeatureEnabled", false)
38+
}
3739
```
3840

3941
For more information about all the configuration options, see

0 commit comments

Comments
 (0)