Slide 46
Slide 46 text
DPOGFSFODFBQQ3FBM'FFE7JFX.PEFMLU
@HiltViewModel
class RealFeedViewModel @Inject constructor(
private val repository: FeedRepository,
) : ViewModel(), FeedViewModel {
private val effectChannel = …
private val showProgressLatch = …
override val effect: Flow = …
init {…}
private val allFeedContents: StateFlow>
private val filters: MutableStateFlow = MutableStateFlow(Filters())
override val state: StateFlow
override fun event(event: FeedViewModel.Event) {
viewModelScope.launch {
@Exhaustive
when (event) {…}
}
}
private suspend fun refreshRepository() {…}
}
interface FeedViewModel : UnidirectionalViewModel {
data class State(
val showProgress: Boolean = false,
val filters: Filters = Filters(),
val filteredFeedContents: FeedContents = FeedContents(),
)
sealed class Effect {…}
sealed class Event {…}
override val state: StateFlow
override val effect: Flow
override fun event(event: Event)
}
IUUQTHJUIVCDPN%SPJE,BJHJDPOGFSFODFBQQ