Skip to content
/ Jungle Public

A simple MVI library with example of usage with Clean Architecture.

License

Notifications You must be signed in to change notification settings

C5FR7Q/Jungle

Repository files navigation

Jungle

Download License

Jungle is a Kotlin MVI library, that uses RxJava and its reactive approach.

Advantages of this lib:

  • Easy to understand and use
  • Can improve project structure
  • Goes well with Clean Architecture

Inspired by

Getting started

Download

Gradle:

implementation 'com.github.c5fr7q:jungle:1.2.1'

Maven:

<dependency>
  <groupId>com.github.c5fr7q</groupId>
  <artifactId>jungle</artifactId>
  <version>1.2.1</version>
  <type>pom</type>
</dependency>

Base vokabulary

  • State - an entity, that contains data about persistent part of UI.
  • Action - an entity, that contains data about unstable part of UI.
  • Event - an Intent of user.

Base classes

  • Store - this is where the magic is. Analogue of Presenter from MVP. Middleman between Model and View.
  • Middleware - a middleman between one functionality of business logic and UI.
  • MviView - a View from MVI. An interface, that contains two methods for dealing with actions and states.

Under the hood

alt text

Usage examples

  1. Creating first store
  2. Dispatching events
  3. Dealing with Middleware
  4. Producing States
  5. Producing Actions
  6. What to use, State or Action?

Articles