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

Reactive Programming

Open CristianMG opened this issue 5 years ago • 3 comments

Any idea that how to use this architecture to be able to observe changes in database or firebase etc.

Could be modified or create a new use case class

Greetings

CristianMG avatar Apr 24 '19 06:04 CristianMG

The usecase classes only do the equivalent of Single<Result<T>> and therefore you'd need to ditch the usecase and rather observe something that lets you observe it.

Zhuinden avatar Apr 24 '19 13:04 Zhuinden

The repositories can expose directly their Reactive functions to ViewModel.

It would be correct to use the functions that can be reactive as functions of RX-Java and the other functions as Coroutines.

Or is better to renounce to Rx-Java and use only Coroutines as Reactive Streams for instance Channels of Coroutines.

The other way isn´t using the coroutines of Kotlin and uses only the Rx-Java functions.

It would better use only one framework?

I think would better unify the data access for don´t break the pattern depending on the type of functions a people need.

Sorry but the English not is my native language

Thanks for your response

CristianMG avatar Apr 24 '19 19:04 CristianMG

Why not to create separate use-case abstraction which will satisfy the reactive execution unit! For instance FlowUseCase<in T, out T>

ghost avatar Feb 13 '22 19:02 ghost