Code Monkey home page Code Monkey logo

feedbacktree's Introduction

FeedbackTree

The API is not stable yet as we are still experimenting with the concept.

FeedbackTree is a unidirectional data flow architecture for Android which relies heavily on state mahines to perform all types of side effects, like network calls, bluetooth, UI updates as well as navigation.

Why FeedbackTree?

  • Organizes the code around the business rules.
  • Reactive Declarative UI
  • Built-in navigation
  • Logic can be easily unit tested
    • Most logic is placed in the Stepper which is pure function.
    • Side effect are isolated and testing can be done with a TestScheduler.

Core concepts

  • Business rules are wrapped in a Flow. You kickstart the Flow with some input and wait for the output to be produced.
  • The Flow is driven by a state machine.
  • You emit Events to advance the Flow.
  • Stepper is used to progress or complete a Flow based on the Events received. It is a pure function which makes unit testing very straightforward.
  • Feedback loops are used separate business logic from side effects like network calls, database operations, timers, bluetooth...

Installation

The project recently migrated from jitpack to Maven Central

Add it in your root build.gradle:

allprojects {
  repositories {
    mavenCentral()
  }
}

Android Projects

Add this to your build.gradle (app)

dependencies {
  implementation "com.github.eliekarouz.feedbacktree:feedbacktree:0.13.1"
  implementation "com.github.eliekarouz.feedbacktree:core:0.13.1"
}

Proguard Rules

You need to add this to your proguard-rules.pro:

-keep class com.feedbacktree**

Kotlin Multiplatform

We are only supporting the concept of Step and Stepper in Kotlin multiplatform (iOS/Android only).
We might provide additional multiplatform support in the future. To include these concepts to a multipatform module, add this dependency to commonMain.

dependencies {
    api "com.github.eliekarouz.feedbacktree:core:0.13.1"
}

If you are targeting iOS you will also need to export the dependencies:

framework("Example") {
    export "com.github.eliekarouz.feedbacktree:core:0.13.1"
    transitiveExport = true
}

Versions

Kotlin FeedbackTree
1.3.72 0.10.2
1.4.0 0.11
1.4.10 0.11.1
1.4.30 0.13.1

Acknowledgements

The following repos were a great source of inspiration:

feedbacktree's People

Contributors

eliekarouz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.