Hey guys, we have an orbit container that takes care of getting data from the network and/or the cache, handles errors and emit the appropriate state. We use it quite a lot when it comes to simply getting data, but sometimes we need to add more logic to it. How do you go about combining multiple containers to compose behaviours? Inheritance isn't really an option, so we thought about composition: creating 2 containers having one listening to the generic one's state but it doesn't seem very clean.
v
Vishnu Ravi
04/17/2023, 9:24 AM
I tried something similar in order to mimic 'redux', but ended up with nested intents and so had to drop this idea.
Finally, I ended up relying on POJOs(Store, Usecases) that exposes regular flows and
Flow.combine
these with the respective container stateflow to get the desired state. Like you said, I'm also not that happy with this approach and still exploring other options.