michalliu / kotlin-bloc

BLoC pattern implementation for Kotlin/Android.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Release

Kotlin BLoC

BLoC pattern implementation for Kotlin/Android. Inspired by bloc library for Flutter.

What is BLoC

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.

How to install

Add the JitPack repository

Add it in your root build.gradle:

Groovy:

allprojects {
    repositories {
        // ...
        maven { url 'https://jitpack.io' }
    }
}

Kotlin

allprojects {
    repositories {
        // ...
        maven(url = "https://jitpack.io")
    }
}

Add the dependency

Add it to your app build.gradle:

Groovy

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
}

Kotlin

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
}

How to use

See example module.

About

BLoC pattern implementation for Kotlin/Android.

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Kotlin 100.0%