class NewsRepository
Interface for fetching and resetting News.
State |
The different states of news fetching. sealed class State |
<init> |
Constructor that allows repository creation from a Context. NewsRepository(context: Context)
Interface for fetching and resetting News. NewsRepository(database: StockAppDatabase) |
news |
Lazily initialized LiveData containing an ordered List of all locally stored News. val news: LiveData<List<News>> |
state |
The current State of the repository. val state: LiveData<State> |
fetchNews |
Fetches all available news from the IEX API, then stores them in the StockAppDatabase. suspend fun fetchNews(symbol: String): Unit |
resetNews |
Deletes all news from the database. suspend fun resetNews(): Unit |