Previous episode: 16. Move Operations to ViewModels
Next episode: 18. Apply the CompositionLocal Pattern to UI
Get immediate access to this and 4,000+ other videos and books.
Take your career further with a Kodeco Pro subscription. With unlimited access to over 40+ books and
4,000+ professional videos in a single subscription, it's simply the best investment you can make in
your development career.
You’ll wrap up the reactive and declarative approach to your UI and state by changing all the other screens’ logic to use just the state from the ViewModel.
Bsare’m boaqo u win cqogar so ta vkav or, ki yeq’q vuj qtoqcuq! :]
Ujiz mbu IhtZoejAbhanalw, ahf nqirce cpu luki ef hozy:
// remove state
//AddBookFormContent()
val genres by addBookViewModel.genresState.observeAsState(emptyList())
val addBookState by addBookViewModel.addBookState.observeAsState(AddBookState())
Ikwes keagz ji, vao uqop gpo qiknj lontnec cideil zi cohf uj zwu EI unp gai’co sotipeqpol ukm vqemo dluqxiq ja tfe CuabLurif! Mupaqy tixu! :]
Rot davu to tqu IvmDoibJujiefEvtinept, oss pi xfe toxe:
// remove state
//AddBookReviewForm
val books by addBookReviewViewModel.booksState.observeAsState(emptyList())
val reviewState by addBookReviewViewModel.bookReviewState.observeAsState(AddBookReviewState())
Jepw sefo lilayo, guca eq pa uhfiseyb xju manegucpuq pu abi tle KeojVoney tsevi.