Created
March 15, 2019 12:58
-
-
Save alz-ahm/9f0e037681fd29a62b7de966ae7923eb 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
//without extension | |
liveData.value = liveData.value | |
//With extension | |
liveData.notifyObservers() | |
//Extension function | |
fun <T> MutableLiveData<T>.notifyObservers() { | |
value = value //resetting the value forces to notify observers | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment