All Projects → NoTests → Rxfeedback.kt

NoTests / Rxfeedback.kt

Licence: mit
Android architecture

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to Rxfeedback.kt

Unidirectional Architecture On Mobile
Dive into 📱 Unidirectional Architecture!
Stars: ✭ 115 (+112.96%)
Mutual labels:  rxjava, architecture
Android Architecture
🌇该项目结合 MVP 与 Clean 架构思想,探索在 Android 项目上的最佳实践。
Stars: ✭ 112 (+107.41%)
Mutual labels:  rxjava, architecture
Thirtyinch
a MVP library for Android favoring a stateful Presenter
Stars: ✭ 1,052 (+1848.15%)
Mutual labels:  rxjava, architecture
Android Starter
[Android Architecture] Android starter based on MVP/Dagger2/RxJava2/Robolectric/Espresso/Mockito. It provides a generator to fast create a Android template project.
Stars: ✭ 522 (+866.67%)
Mutual labels:  rxjava, architecture
Android Clean Architecture Boilerplate
Apply clean architecture on Android
Stars: ✭ 141 (+161.11%)
Mutual labels:  rxjava, architecture
Mvparms
⚔️ A common architecture for Android applications developing based on MVP, integrates many open source projects, to make your developing quicker and easier (一个整合了大量主流开源项目高度可配置化的 Android MVP 快速集成框架).
Stars: ✭ 10,146 (+18688.89%)
Mutual labels:  rxjava, architecture
Alfonz
Mr. Alfonz is here to help you build your Android app, make the development process easier and avoid boilerplate code.
Stars: ✭ 90 (+66.67%)
Mutual labels:  rxjava, architecture
Android Base Mvp
Android Base MVP Concept with RXJava, Dagger, Event Bus, Retrofit, Glide, OkHTTP
Stars: ✭ 141 (+161.11%)
Mutual labels:  rxjava, architecture
Viabus Architecture
让 Android 开发可以像流水线一样高效的,职责分离架构 ⚡ 不同于 MVP 的配置解耦,也不能和 似是而非 的 MVVM - Clean 同日而语。VIABUS 是世界范围内首个明确提出,通过职责分离,来真正实现 UI 和 业务并行开发的 Android 项目级开发架构和设计模式理念。
Stars: ✭ 485 (+798.15%)
Mutual labels:  rxjava, architecture
Rx.observe
Transform any method to an Rx Observable ! (VIPER)
Stars: ✭ 34 (-37.04%)
Mutual labels:  rxjava, architecture
Ethdroid
Easy-to-use Ethereum Geth wrapper for Android
Stars: ✭ 47 (-12.96%)
Mutual labels:  rxjava
Bigbang
Android base project used by Xmartlabs team
Stars: ✭ 47 (-12.96%)
Mutual labels:  rxjava
Cleanarchitecturetemplate
A template for a dotnet core api / mvc "clean architecture" project.
Stars: ✭ 50 (-7.41%)
Mutual labels:  architecture
Mvvmc Splitviewcontroller
Example project with UITabBarController inside UISplitViewController using RxSwift and MVVM-C architecture.
Stars: ✭ 45 (-16.67%)
Mutual labels:  architecture
Graphql Retrofit Converter
A Retrofit 2 Converter.Factory for GraphQL.
Stars: ✭ 46 (-14.81%)
Mutual labels:  rxjava
Complex Redux Project Architecture
Redux architecture extended with a layer of services.
Stars: ✭ 53 (-1.85%)
Mutual labels:  architecture
2018 Android Architecture Components Workshop
Android Architectures & Architecture Components Hands-on
Stars: ✭ 45 (-16.67%)
Mutual labels:  architecture
Super Simple Architecture
🧩 Super Simple Architecture in Swift
Stars: ✭ 44 (-18.52%)
Mutual labels:  architecture
Mockstar
Demo project on How to be a Mockstar using Mockito and MockWebServer.
Stars: ✭ 53 (-1.85%)
Mutual labels:  rxjava
Rxnearby
Nearby handling APIs for Android Apps using RxJava
Stars: ✭ 52 (-3.7%)
Mutual labels:  rxjava

CircleCI

RxFeedback

Kotlin version of RxFeedback

20min video pitch

The simplest architecture for RxJava

    typealias Feedback<State, Event> = (Observable<State>) -> Observable<Event>

    fun <State, Event> system(
            initialState: State,
            reduce: (State, Event) -> State,
            vararg feedback: Feedback<State, Event>
        ): Observable<State>

Why

  • Straightforward

    • if it's state -> State
    • if it's a way to modify state -> Event/Command
    • it it's an effect -> encode it into part of state and then design a feedback loop
  • Declarative

    • System behavior is first declaratively specified and effects begin after subscribe is called => Compile time proof there are no "unhandled states"
  • Debugging is easier

    • A lot of logic is just normal pure function that can be debugged using Android studio debugger, or just printing the commands.
  • Can be applied on any level

    • Entire system
    • application (state is stored inside a database, Firebase, Realm)
    • Activity/Fragment/ViewModel(Android Architecture Component) (state is stored inside system operator)
    • inside feedback loop (another system operator inside feedback loop)
  • Works awesome with dependency injection

  • Testing

    • Reducer is a pure function, just call it and assert results
    • In case effects are being tested -> TestScheduler
  • Can model circular dependencies

  • Completely separates business logic from effects (Rx).

    • Business logic can be transpiled between platforms (ShiftJS, C++, J2ObjC)

Examples

Simple UI Feedback loop

Observables.system(initialState = 0,
                reduce = { state, event: Event ->
                    when (event) {
                        Event.Increment -> state + 1
                        Event.Decrement -> state - 1
                    }
                },
                scheduler = AndroidSchedulers.mainThread(),
                scheduledFeedback = listOf(
                        bind {
                            val subscriptions = listOf(
                                    it.source.map { it.toString() }.subscribe { label.text = it }
                            )
                            val events = listOf(
                                    RxView.clicks(plus).map { Event.Increment },
                                    RxView.clicks(minus).map { Event.Decrement }
                            )
                            return@bind Bindings(subscriptions, events)
                        }
		)
	)

Play Catch

Simple automatic feedback loop.

Observables.system(
                initialState = State.HumanHasIt,
                reduce = { state, event: Event ->
                    when (event) {
                        Event.ThrowToMachine -> State.MachineHasIt
                        Event.ThrowToHuman -> State.HumanHasIt
                    }
                },
                scheduler = AndroidSchedulers.mainThread(),
                scheduledFeedback = listOf(
                        bindUI,
                        react<State, Unit, Event>(query = { it.machinePitching},
				effects = {
				    Observable.timer(1, TimeUnit.SECONDS, AndroidSchedulers.mainThread())
					    .map { Event.ThrowToHuman }
					    }
			)
                )
	)

Paging

Driver.system(
                initialState = State.empty,
                reduce = { state: State, event: Event -> State.reduce(state, event) },
                feedback = listOf(bindUI,
                        reactSafe<State, String, Event>(
                                query = { it.loadNextPage },
                                effects = {
                                    repositoryService.getSearchRepositoriesResponse(it)
                                            .asSignal(onError = Signal.just(Result.Failure(GitHubServiceError.Offline) as SearchRepositoriesResponse))
                                            .map { Event.Response(it) }
                                }
                        )))

How to include?

Add it in your root build.gradle at the end of repositories:

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

Add the dependency

implementation 'com.github.NoTests:RxFeedback.kt:x.y.z'
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].