//Android/br.com.arch.toolkit.android.util/ConfigValue
data class ConfigValue<T : Any>(name: String, default: T, storage: () -> KeyValueStorage)
A wrapper class that provides a way to observe and manage a configuration value stored in KeyValueStorage.
It provides both androidx.lifecycle.LiveData and kotlinx.coroutines.flow.Flow for observation.
android
| Â | Â |
|---|---|
| T | The type of the value being stored. |
| Â | Â |
|---|---|
| ConfigValue | [android] constructor(name: String, default: T, storage: () -> KeyValueStorage) |
| Name | Summary |
|---|---|
| flow | [android] val flow: Flow<T> Returns a kotlinx.coroutines.flow.Flow to observe changes to the value. |
| liveData | [android] val liveData: LiveData<T> Returns a androidx.lifecycle.LiveData object to observe changes to the value. |
| Name | Summary |
|---|---|
| get | [android] fun get(): T Retrieves the current value. |
| set | [android] fun set(value: T) Updates the value and persists it to storage. |