Hey guys, I'm in doubt with Retrofit and coroutine...
# android-architecture
r
Hey guys, I'm in doubt with Retrofit and coroutines. If I have a livedata which is returning my favourites films from and API and I observe this livedata and show the films in the screen. If I add a new film in my favourites, is the livedata going to emit this new film? Do I need to call the API again?
k
You will need to call your API again if you want to ingest your new film. Whatever observes the livedata should react to this new film however you define e.g. updating a recyclerview adapter with the new item.
1
u
or use some storage which emits its new state on change, like a database -- sqldelight/room