class SymbolRepository
Repository for refreshing, accessing and filtering Symbols.
State |
The state of a SymbolRepository. sealed class State |
<init> |
Constructor that allows repository creation from a Context. SymbolRepository(context: Context)
Repository for refreshing, accessing and filtering Symbols. SymbolRepository(database: StockAppDatabase) |
state |
The current State of the repository. val state: LiveData<State> |
symbols |
List of all Symbols. val symbols: LiveData<List<Symbol>> |
filteredSymbols |
Returns a LiveData containing Symbols that match the specified Symbol.Filter. fun filteredSymbols(filter: Filter): LiveData<List<Symbol>> |
hasSymbols |
Checks if there are any Symbols in the StockAppDatabase. suspend fun hasSymbols(): Boolean |
refreshSymbols |
Fetches all available symbols from the IEX and CoinGecko APIs, then stores them in the StockAppDatabase. suspend fun refreshSymbols(): Unit |