Skip to content

Instantly share code, notes, and snippets.

@charlag
Last active September 10, 2017 10:11
Show Gist options
  • Save charlag/1180c9cdfa1c7575a0703cfbf0142073 to your computer and use it in GitHub Desktop.
Save charlag/1180c9cdfa1c7575a0703cfbf0142073 to your computer and use it in GitHub Desktop.
val state = BehaviourSubject.create<State>()
nameInput.withLatestFrom(state) { name, state ->
state.copy(name = name)
}
.subscribe(state)
checkBoxChecks.withLatestFrom(state) { сbState, state →thLa
state.copy(checkBoxCheched = cbState)
}
.subscribe(state)
database.dao().loadById(…).map { somethingFromDb ->
State(…)
}
.subscribe(state)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment