Nikiizvorski
03/17/2021, 4:36 PMArkadii Ivanov
03/17/2021, 11:04 PMPostProcessor
. This gives MVICore some additional purity, which might be improve maintainability. In MVIKotlin you have getState: () -> State
supplier that always returns the current state. This reduces boiler plate code, sometimes significantly, and so there is no PostProcessor
required.
• In MVICore if you want to publish some News (aka side effects), you have to use NewsPublisher
. This again due to that purity. In MVIKotlin you can publish Labels (same thing as News in MVICore) directly from Executor
, and so no NewsPublisher
is required. Again purity vs boiler plate code.
• MVICore is developed and heavily used by Badoo/Bumble, which is quite a big company. So it is proved to work well. MVIKotlin is developed by me in my spare time, however there are known users/companies as well.
• If you are planning to use Kotlin Multipaltform, then at the moment you can't use MVICore in common code, because it depends on RxJava2. MVIKotlin is multiplatform library, and supports Reaktive and Coroutines.
• The way how you create Stores/Features is also different. In MVICore you are encouraged to extend BaseFeature
class or one of its descendants, and pass components to super. In MVIKotlin you usually use StoreFactory
interface where you pass components, and it creates an implementation for you.
• Both libraries provide logging and time travel functionality. However the way how it is implemented is different. MVICore has global middleware registry, and logging and time travel are middlewares provided by the library. In MVIKotlin there are different Store implementations, and so different Bot libraries have logging and time travel functionality. However their implementation is also different. In MVICore there are middlewares, logging and time travel are middlewares. There is a global middleware registry, which is used by the library internally. In MVIKotlin there are separate Store implementation for logging and time travel, and so separate store factories. You can combine factories or even implement your own Store implementations.
• There is also such a thing as binder
in both libraries. In both libraries it makes lifecycle-aware connections between inputs with outputs. However in MVICore the binder
also has responsibility to wrap consumers into middlewares from the global registry.Nikiizvorski
03/18/2021, 8:22 AM