Slide 7
Slide 7 text
ViewModel
/* ؆୯ͷͨΊʹॾʑলུͯ͠·͢ɻ */
class ForYouViewModel {
private val followedInterestsState: StateFlow =
repository.userDataStream
.map { /* Ճ */ }
.stateIn(/* ॳظείʔϓͳͲ */)
val feedState: StateFlow =
combine(
followedInterestsState,
/* ͦͷଞͷRepositoryΞΫηεͳͲ */
) {
/*
* - combineͷ֤ཁૉ͕ඞཁͳॲཧ
* - UiStateܕʹม
*/
}
}
RepositoryͷΛऔಘɾ
Ճͯ͠ViewʹStateFlowΛ
ެ։͢Δɻ