Change FeatureFlagService.isFeatureEnabled return value from Boolean to Flow<Boolean>
This commit is contained in:
parent
5f85707235
commit
f554fb8dcc
10 changed files with 62 additions and 25 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue