You are currently viewing Getting LiveData from repository to View ?

Getting LiveData from repository to View ?

I’m working on a project with the architecture View > ViewModel > Repository

The repository is listening to a Firestore Database in real time and updating LiveData everytime the database is updated.

My first idea was to observe those LiveData in the ViewModel, then have the View observe those LiveData from the ViewModel.

But i’ve seen multiple times that the ViewModel should absolutely not observe LiveData, so how can I get those LiveData up to the View if I cannot observe them from the ViewModel ?

There probably is something I should change about the architecture but I’m not sure what.

Thanks for your help 🙂

submitted by /u/MonkeyWaffle1
[link] [comments]