android5-1 Exercise 1: Sorting Responsibilities ============================================ Responsibilities in the "no architecture" NotesScreen, and where each belongs: Drawing the text and list ........................ UI layer (the composable) Showing "Loading..." while waiting ................ UI layer (decided from state) Holding the notes and the loading flag ............ state holder (ViewModel, Chapter 2) Starting the load (LaunchedEffect) ................ state holder Calling the network or database ................... data layer (repository, Chapters 4, 5 and 7) Parsing the response into notes ................... data layer Deciding what to do on an error ................... state holder (turns it into UI state) Left in the composable: take a UI state and callbacks, draw. (General knowledge; the layers come from the docs.)