Android-CleanArchitecture-Kotlin icon indicating copy to clipboard operation
Android-CleanArchitecture-Kotlin copied to clipboard

Question about database observing

Open SeanBlahovici opened this issue 7 years ago • 2 comments

I am currently porting my project from the java Clean Architecture structure to the Kotlin structure. I am using the Cloud Firestore database and in my previous project I had a snapshot listener that would emit data every time new data was added to the database. The presenters would be notified by each update (via RXJava observables) and then update the UI.

From what I can see the MoviesRepository.movies() function has to be invoked by the MoviesFragment manually to see any updated data.

Am I correct in assuming this new architecture no longer supports real-time model updates? Has anyone adapted this solution to support reactive streams without RX Java?

Thanks for the help!

SeanBlahovici avatar Jun 08 '18 00:06 SeanBlahovici

Using singles never supported it in the use-case either.

But yes, you are right. These setups always assume you want to loadData(Callback instead of subscribeForDataChanges(Observer for some reason.

Zhuinden avatar Jun 08 '18 11:06 Zhuinden

Can anyone answer this question, in regards to replacing retrofit with Firebase/cloud Firestore? https://stackoverflow.com/questions/50825802/making-synchronous-calls-to-cloud-firestore-when-running-in-kotlin-coroutine Any help would be much appreciated.

SeanBlahovici avatar Jun 12 '18 21:06 SeanBlahovici