Change FeatureFlagService.isFeatureEnabled return value from Boolean to Flow<Boolean>

This commit is contained in:
Benoit Marty 2023-10-31 16:48:24 +01:00 committed by Benoit Marty
parent 5f85707235
commit f554fb8dcc
10 changed files with 62 additions and 25 deletions

View file

@ -16,13 +16,23 @@
package io.element.android.libraries.featureflag.api
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.first
interface FeatureFlagService {
/**
* @param feature the feature to check for
*
* @return true if the feature is enabled
*/
suspend fun isFeatureEnabled(feature: Feature): Boolean
suspend fun isFeatureEnabled(feature: Feature): Boolean = isFeatureEnabledFlow(feature).first()
/**
* @param feature the feature to check for
*
* @return a flow of booleans, true if the feature is enabled, false if it is disabled.
*/
fun isFeatureEnabledFlow(feature: Feature): Flow<Boolean>
/**
* @param feature the feature to enable or disable