Skip to content

Instantly share code, notes, and snippets.

View starry-shivam's full-sized avatar
🌟
Focusing

Stɑrry Shivɑm starry-shivam

🌟
Focusing
View GitHub Profile
@stevdza-san
stevdza-san / RequestState.kt
Last active October 9, 2024 12:56
Useful wrapper class for handling the data in Jetpack Compose
import androidx.compose.animation.AnimatedContent
import androidx.compose.animation.core.tween
import androidx.compose.animation.fadeIn
import androidx.compose.animation.fadeOut
import androidx.compose.animation.togetherWith
import androidx.compose.runtime.Composable
sealed class RequestState<out T> {
data object Idle : RequestState<Nothing>()
data object Loading : RequestState<Nothing>()