What are the advantages of using a Store and a Reducer in Composable Architecture?

57 Views Asked by At

I'm looking into The Composable Architecture from the point of view of an Android developer.

It's quite similar to the MVI pattern that is much more common for android apps but I wonder what are the advantages of decoupling the logic of a ViewModel into a Store + Reducer?

Isn't it more straight forward to have a class declaring several functions equivalent to all the actions the reducer can handle? It is also less computation to go through (even though it doesn't make any difference in app world most of the time). I don't think it is more testable neither, both approach are similar. We can observe the state changes when the input is an action sent to a reducer or calling a function on a class.

Am I missing anything here?

0

There are 0 best solutions below