hpost / rx-mvi

Minimal framework for Model View Intent inspired Android applications written in Kotlin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

rx-mvi

Proposal for reactive UI applications inspired by Model View Intent written in Kotlin.

A UI component consists of a View and a Model. The View is responsible for rendering state and forwarding user input to the Model. The Model is processing user input and external state to produce a State stream, which is in turn rendered by the View.

The proposed pattern embraces the concept of unidirectional data flow and makes heavy use of Reactive Streams. The resulting UI components are fractal and can be nested to form larger components.

It is inspired by concepts like Cycle.js, Redux, and this article by André Staltz.

Alt MVI diagram

Example

Please refer to reactive-android-architecture for an example app demonstrating the use of rx-mvi.

Observing state

Take a look at rx-mapping-extensions for useful extensions that encapsulate common operations when observing (partial) state.

Binaries

dependencies {
    implementation "cc.femto:rx-mvi:4.3.0"
}

Requires the JitPack repository:

repositories {
    maven { url "https://jitpack.io" }
}

About

Minimal framework for Model View Intent inspired Android applications written in Kotlin

License:Other


Languages

Language:Kotlin 100.0%