Updated on 2026-08-14
This commit is contained in:
parent
7fdf9167ea
commit
5a277755c4
4 changed files with 12 additions and 2 deletions
|
|
@ -30,6 +30,14 @@ internal class DefaultQuotesStore(
|
|||
}
|
||||
}
|
||||
|
||||
override suspend fun getSync(currenciesIds: Set<CryptoCurrency.ID>): Set<StoredQuote> {
|
||||
return currenciesIds.mapNotNull { currencyId ->
|
||||
currencyId.rawCurrencyId?.let {
|
||||
dataStore.getSyncOrNull(it)
|
||||
}
|
||||
}.toSet()
|
||||
}
|
||||
|
||||
override suspend fun store(response: QuotesResponse) {
|
||||
val quotes = response.quotes.mapValues { (id, quote) ->
|
||||
StoredQuote(id, quote)
|
||||
|
|
|
|||
|
|
@ -9,5 +9,7 @@ interface QuotesStore {
|
|||
|
||||
fun get(currenciesIds: Set<CryptoCurrency.ID>): Flow<Set<StoredQuote>>
|
||||
|
||||
suspend fun getSync(currenciesIds: Set<CryptoCurrency.ID>): Set<StoredQuote>
|
||||
|
||||
suspend fun store(response: QuotesResponse)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue