Skip to content

Commit

Permalink
Cleanup home viewmodel
Browse files Browse the repository at this point in the history
  • Loading branch information
ovitrif committed Dec 3, 2023
1 parent dc8b08a commit 9620231
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions app/src/main/java/tech/masivo/bitlab/ui/HomeViewModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import javax.inject.Inject
class HomeViewModel @Inject constructor(
private val mempoolWebSocketClient: MempoolWebSocketClient,
) : ViewModel() {
private val _uiState = MutableStateFlow(initUiState())
private val _uiState = MutableStateFlow(UiState())
val uiState: StateFlow<UiState> = _uiState

init {
Expand All @@ -35,20 +35,8 @@ class HomeViewModel @Inject constructor(
}
}

private fun onBlockClick(id: String) {
TODO("Clicked block with id: $id")
}

// REGION: State
private fun initUiState(): UiState {
return UiState(
onBlockClick = ::onBlockClick,
)
}

data class UiState(
val title: String = "Bitcoin Blocks Explorer",
val onBlockClick: (id: String) -> Unit = {},
val blocks: List<Block> = emptyList(),
val transactions: List<Transaction> = emptyList(),
)
Expand Down

0 comments on commit 9620231

Please sign in to comment.