hi everybody 👋
At dreipol we've started using KMM in combination with Redux-Kotlin to develop iOS and Android Apps 📱android dance. We've recently published a blog post about the architecture. It comes a long with a free app. Feel free to check it out! We are keen to hear your opinions and questions 🙂
01/20/2021, 3:45 PM
I have a question what I was wondering: What is the actual benefit of using redux? What can I achieve with it what I cannot achieve using a StateFlow?
01/20/2021, 4:44 PM
@Joost Klitsie I think StateFlow is more a technical thing, whereas redux is a whole architecture pattern. You could even combine them.
Redux contains, besides the appState, reducers, middlewares and actions.
I think redux in a KMM setup forces you to put much logic into the shared module. Further, in a team of android and iOS developers, it creates a common understanding of how and where logic should happen.
Off course, you can achieve all that without using redux.
01/20/2021, 10:35 PM
@kai widmer thanks for your answer! But my question is: is the dependency worth it? Didnt the great tools provided by kotlin make things like redux, as well as rxjava, obsolete? And if so, wouldnt it make sense to drop these tools? Or do they still provide additional functionality what you cannot get out of kotlin? (Like immutable variables and coroutine flows)
01/21/2021, 8:58 AM
@Joost Klitsie Yeah I see your point. If we talk about redux…
… as a pattern:
• I see the benefits as I described them above
• because it is a pattern, it’s a language independent thing, it doesn’t matter if you use kotlin or any other language
.. as a technical dependency from ReduxKotlin
• I think it makes great use of kotlin features like data class and can be easily combined with some others like coroutines
• If you don’t want to start from scratch it provides you the tools needed to use state-store, actions, middlewares and reducers.
• for sure, you could get rid of it and implement the pattern by your own (or a variant of it), more lightweight to fit perfectly your needs
• for us developing apps with KMM was new and we didn’t want to implement the redux pattern from scratch, so ReduxKotlin gave us a nice boost
Hope this explains how I’m thinking about it 🙂