app / de.uniks.codliners.stock_simulator.repository / SymbolRepository

SymbolRepository

class SymbolRepository

Repository for refreshing, accessing and filtering Symbols.

Types

State

The state of a SymbolRepository.

sealed class State

Constructors

<init>

Constructor that allows repository creation from a Context.

SymbolRepository(context: Context)

Repository for refreshing, accessing and filtering Symbols.

SymbolRepository(database: StockAppDatabase)

Properties

state

The current State of the repository.

val state: LiveData<State>

symbols

List of all Symbols.

val symbols: LiveData<List<Symbol>>

Functions

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