Skip to content

Instantly share code, notes, and snippets.

@CesarValiente
Last active March 24, 2018 18:42
Show Gist options
  • Save CesarValiente/91b2ad8a2bff96dbc13dc84bb5df1fa9 to your computer and use it in GitHub Desktop.
Save CesarValiente/91b2ad8a2bff96dbc13dc84bb5df1fa9 to your computer and use it in GitHub Desktop.
abstract class ControllerView(
val store: Store,
mainThread: ThreadExecutor? = null)
: LifecycleCallbacks, StateHandler(mainThread) {
override fun onStart() {
store.stateHandlers.add(this)
}
override fun onDestroy() {
store.stateHandlers.remove(this)
}
override fun handle(data: State) {
handleState(data)
}
abstract fun handleState(state: State)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment