Skip to content

Instantly share code, notes, and snippets.

@chitrang200889
chitrang200889 / RecomposeUiComponentOnly.kt
Created January 22, 2024 06:22
Recompose UiComponent Only
data class SellerData(val count: Int)
data class BuyerData(val count: Int)
@Stable
class UiState {
val sellerData = mutableStateOf<SellerData>(SellerData(0))
val buyerData = mutableStateOf<BuyerData>(BuyerData(0))
}
@chitrang200889
chitrang200889 / RecomposeEntireScreen.kt
Last active January 23, 2024 04:09
Recompose Entire Screen
data class UiState(
val sellerCount: Int,
val buyerCount: Int
)
class MainActivity : ComponentActivity() {
private val _uiState = MutableStateFlow<UiState>(
UiState(
sellerCount = 0,