https://kotlinlang.org logo
#compose
Title
# compose
s

Socheat KHAUV

05/29/2020, 1:26 PM
I read JetNews sample I saw this statement
Copy code
val (postsState, refreshPosts) = refreshableUiStateFrom(postsRepository::getPosts)
I am a kotlin beginner, mabye could someone explain what mean ?
t

Tolriq

05/29/2020, 1:33 PM
k

katokay

05/29/2020, 2:27 PM
The variables in the first part are "destructured" from the return value of the function call to refreshableUiStateFrom which takes an argument of type function (I'm not sure on the signature of the function from the sample), and the value being passed to it is the function getPosts contained inside the type postsRepository. Hope that helps.
s

Socheat KHAUV

05/30/2020, 3:16 PM
@Tolriq @katokay - thanks you, I understood now.