Skip to content

Commit

Permalink
feat: set evaluation-context in setProviderAndWait() (#80)
Browse files Browse the repository at this point in the history
Signed-off-by: Nicklas Lundin <[email protected]>
  • Loading branch information
nicklasl authored Dec 19, 2023
1 parent 765efab commit e19dd88
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions android/src/main/java/dev/openfeature/sdk/async/Extensions.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package dev.openfeature.sdk.async

import dev.openfeature.sdk.EvaluationContext
import dev.openfeature.sdk.FeatureProvider
import dev.openfeature.sdk.OpenFeatureAPI
import dev.openfeature.sdk.OpenFeatureClient
Expand Down Expand Up @@ -27,9 +28,10 @@ fun OpenFeatureClient.toAsync(): AsyncClient? {

suspend fun OpenFeatureAPI.setProviderAndWait(
provider: FeatureProvider,
dispatcher: CoroutineDispatcher
dispatcher: CoroutineDispatcher,
initialContext: EvaluationContext? = null
) {
setProvider(provider)
setProvider(provider, initialContext)
provider.awaitReady(dispatcher)
}

Expand Down

0 comments on commit e19dd88

Please sign in to comment.