I´m following the Udacity course to learn how to develop android apps, and I don´t understand the following piece of code:
private val night = MediatorLiveData<SleepNight>()
fun getNight() = night
init {
night.addSource(database.getNightWithId(sleepNightKey), night::setValue)
}
Specifically, I don´t understand the "::" part, from some answers to this question I know that is used to transform a function into a lambda, I also checked the official docs and says that is used to create a member reference and a class reference, I think in this case it is used to create a member reference but I don´t clearly see how that works in this case.