BLoC pattern implementation for Kotlin/Android. Inspired by bloc library for Flutter.
BLoC (Business Logic Component) is a design pattern for state management that is built around simple yet powerful idea: BLoC is a component that takes events as an input and produces states as an output. From the very high level it can be viewed as a function mapping sequence of events to sequence of states.
Add it in your root build.gradle
:
allprojects {
repositories {
// ...
maven { url 'https://jitpack.io' }
}
}
allprojects {
repositories {
// ...
maven(url = "https://jitpack.io")
}
}
Add it to your app build.gradle
:
dependencies {
implementation 'com.github.MewsSystems.kotlin-bloc:core:[VERSION]' // base functionality
// OR:
implementation 'com.github.MewsSystems.kotlin-bloc:android:[VERSION]' // Android-specific things (includes core as well)
testImplementation 'com.github.MewsSystems.kotlin-bloc:testing:[VERSION]' // for test helpers
}
dependencies {
implementation("com.github.MewsSystems.kotlin-bloc:core:[VERSION]") // base functionality
// OR:
implementation("com.github.MewsSystems.kotlin-bloc:android:[VERSION]") // Android-specific things (includes core as well)
testImplementation("com.github.MewsSystems.kotlin-bloc:testing:[VERSION]") // for test helpers
}
See example module.