Created
April 18, 2021 20:35
-
-
Save Skyyo/cdbb811e199b5c6ff8865797de1f0376 to your computer and use it in GitHub Desktop.
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