inline fun <T> LiveData<Event<T>>.observeEvent(owner: LifecycleOwner, crossinline onEventUnhandledContent: (T) -> Unit) {
observe(owner, Observer { it?.getContentIfNotHandled()?.let(onEventUnhandledContent) })
}
Last active
December 27, 2018 09:26
-
-
Save rachitmishra/6f795a5581f1c71c71673b94e4624d23 to your computer and use it in GitHub Desktop.
Extensions
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment