This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LifecycleAwareCurrenciesViewModel : ViewModel() { | |
private val _currencyPrices = MutableStateFlow(listOf<CurrencyPrice>()) | |
val currencyPrices: StateFlow<List<CurrencyPrice>> get() = _currencyPrices | |
init { | |
getCurrencyPrices() | |
} | |
private fun getCurrencyPrices() {} //same as before | |
fun onCurrencyUpdated(newPrice: Int, index: Int) { } //same as before | |
fun provideCurrencyUpdateFlow(): Flow<Int> { } //same as before | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment