Skip to content

gdxz123/redux_android

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

redux_android

redux with kotlin

Introduction

redux_android is a Redux-like implementation of the unidirectional data flow architecture in kotlin.

Usage

// subscriber
private var testSubscriber: BlockSubscriber<GDState<Int>> = BlockSubscriber { state, isInitail ->
    state.model?.let {
        Log.d("TestState", "TestState is $it")
    }
}


// create subscribe
StoreManager.share().subscribe(testSubscriber, {
    it.select { state ->
        state.data.testState
    }
})

// create action
val actionA = GDAction(type = ActionEnum.TestAction, period = PeriodType.Successed, content = 100)

// dispatch action
StoreManager.share().dispatch(actionA)

About

redux with kotlin

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages