Created
September 10, 2017 10:22
-
-
Save charlag/951a0211590d7ea8493ffa40c2e19bc9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private val addNewTodoEffect = Transformer<State, Event, Event> { upstream -> | |
upstream.ofEventType(Event.NewTodoEvent::class) | |
.observeOn(Schedulers.io()) | |
.switchMap { (_, _, event) -> | |
db.todoDao().add( | |
TodoEntity( | |
id = 0, | |
text = event.text, | |
completed = false | |
) | |
) | |
Observable.empty<Event>() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Very good