Vinay Gaba
03/01/2021, 1:55 AMAdam Powell
03/01/2021, 2:03 AMsnapshotFlow {}
does it emit values for changes or no?Vinay Gaba
03/01/2021, 2:08 AMAdam Powell
03/01/2021, 2:15 AMSnapshot.register
method to register an apply observer which will be a bit more direct/immediate, but the flow should be enough to tell if snspahots are being applied at all or notVinay Gaba
03/01/2021, 2:37 AMSnapshot.sendApplyNotifications()
after updating the state properties to make sure that the changes are propagated. Strangely enough, I don’t see my print statements or debug points being triggered for the snapshotFlow
. This is how I was using it.
snapshotFlow { showkaseBrowserScreenMetadata.value.currentGroup }
.map {
Log.e("Debug", it.toString())
}
Here showkaseBrowserScreenMetadata
is a MutableState
object and the value it holds is a data class with a few properties.
It’s initialized using this line
val showkaseBrowserScreenMetadata =
remember { mutableStateOf(ShowkaseBrowserScreenMetadata()) }
Adam Powell
03/01/2021, 2:56 AMVinay Gaba
03/01/2021, 3:04 AM