Chris Fillmore
04/06/2021, 1:14 AMclass CustomImageLoader : ImageLoader {
@Composable
override fun Image(url: String) {
// Load and draw the image
}
}
Sean McQuillan [G]
04/06/2021, 5:04 PMSean McQuillan [G]
04/06/2021, 5:05 PMthis
pointer is a parameter to Image
Sean McQuillan [G]
04/06/2021, 5:07 PMState<T>
The mapping to make it work correctly:
ctor args -> composable parameters
class members -> hoisted state to a composable
local remember -> composable state
Note that class members in this structure are not equivalent to local state, as they may be shared with multiple invocations (instances) of Image
Chris Fillmore
04/06/2021, 5:09 PMSean McQuillan [G]
04/06/2021, 5:40 PMobject
so people are less likely to add state to the object.Chris Fillmore
04/06/2021, 5:45 PM