Skip to content

Instantly share code, notes, and snippets.

@insacc
Last active July 30, 2018 21:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save insacc/5053c857e509b6f73364801d0e1a3a8b to your computer and use it in GitHub Desktop.
Save insacc/5053c857e509b6f73364801d0e1a3a8b to your computer and use it in GitHub Desktop.
LiveBus subscription example
LiveBus.getInstance().subscribeLiveEvent("EVENT_TAG", EVENT_VALUE_CLASS_TYPE)
.observe(this, Observer {
it?.let {
// Process event
}
})
LiveBus.getInstance().subscribeSingleLiveEvent("EVENT_TAG", EVENT_VALUE_CLASS_TYPE)
.observe(this, Observer {
it?.let {
// Process event
}
})
LiveBus.getInstance().subscribeStickyLiveEvent("EVENT_TAG", EVENT_VALUE_CLASS_TYPE)
.observe(this, Observer {
it?.let {
// Process event
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment