Mobius is a functional reactive framework for managing state evolution and side-effects, with add-ons for connecting to Android UIs and RxJava Observables. It emphasizes separation of concerns, testability, and isolating stateful parts of the code.
Mobius is in Beta status, meaning it is used in production in Spotify Android applications, but we may keep making changes relatively quickly.
Mobius is currently built for Java 7 (because Java 8 is not fully supported on all versions of Android), hence the duplication of some concepts defined in
When using Mobius, we do however recommend using Java 8 or later, primarily because of the improved type inference and because using lambdas greatly improves readability and conciseness of code.
Using it in your project
The latest version of Mobius is available through Maven Central (LATEST_RELEASE below is ):
implementation 'com.spotify.mobius:mobius-core:LATEST_RELEASE' testImplementation 'com.spotify.mobius:mobius-test:LATEST_RELEASE' implementation 'com.spotify.mobius:mobius-rx:LATEST_RELEASE' // only for RxJava 1 support implementation 'com.spotify.mobius:mobius-rx2:LATEST_RELEASE' // only for RxJava 2 support implementation 'com.spotify.mobius:mobius-android:LATEST_RELEASE' // only for Android support implementation 'com.spotify.mobius:mobius-extras:LATEST_RELEASE' // utilities for common patterns
We're using Google's auto-formatter to format the code. The build pipeline is set up to fail builds that aren't correctly formatted. To ensure correct formatting, run
Code of Conduct
This project adheres to the Open Code of Conduct. By participating, you are expected to honor this code.