MVVM on Android · Challenge: ViewModel | raywenderlich.com


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/8984-mvvm-on-android/lessons/10

Thank you very much. I am learning a lot. I have one question.

We have allCreatures in LiveData initialized in init method of RoomRepository.

My Question is how does allCreatures gets updated when we insert a new creature ? Don’t we need to call “creatureDao.getAllCreatures()”

Is it because since it is live data that it keeps an eye on creatureDao.getAllCreatures(), whenever it gets updated ?

@macsimus Can you please help with this when you get a chance? Thank you - much appreciated! :]