Adrian Blanco
07/02/2020, 1:21 PMdelay(1)
seems to make it work as intended, but feels extremely hacky. What would be the idiomatic solution for this?
val imageState = stateFor<ImageState, String>(imageUrl) { ImageState.Loading }
launchInComposition(imageUrl) {
delay(1)
imageState.value = loadImage(imageUrl, targetWidthPx, targetHeightPx)
}
Leland Richardson [G]
07/02/2020, 3:41 PMLeland Richardson [G]
07/02/2020, 3:41 PMLeland Richardson [G]
07/02/2020, 3:43 PMgetImage
method that will address your cache synchronously, that would be the best thing to use in the state lambdaAdam Powell
07/02/2020, 3:49 PMAdam Powell
07/02/2020, 3:50 PMremember
- it seems like a total run-with-scissors API to have around though.Adam Powell
07/02/2020, 3:51 PMAdam Powell
07/02/2020, 3:55 PMMutableState
in an onEnter
doesn't schedule recomposition of readers it's a bug and we should fix it.Adam Powell
07/02/2020, 3:56 PMyield()
over delay(1)
Chuck Jazdzewski [G]
07/02/2020, 5:24 PMLeland Richardson [G]
07/02/2020, 8:20 PMChuck Jazdzewski [G]
07/02/2020, 11:41 PMonEnter
happen outside of a snapshot.Chuck Jazdzewski [G]
07/06/2020, 3:39 PMonEnter
is inside a WithConstraints
or any other sub-composition then the onEnter
is run inside the outer composition's snapshot. I created issue 160597664 to track this.