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

andrew

05/02/2022, 1:55 AM
Can a custom applier run a compose node factory asynchronously? I’m asking because I want to write a custom one for Filament, but some of it may depend on resource loading. Or, would it be best to load x resource first, then run the compose node once readied?
j

jw

05/02/2022, 3:05 AM
Consider a normal composable which does the async load and switches between a placeholder and the filament render
a

andrew

05/02/2022, 3:28 AM
This would be for nodes underneath, like say a light, or something else
In this case, loading a GLTF, GLB, or KTX would be async, I guess that operation would be scoped to the node
Or rather the composable function surrounding the compose node, correct?
j

jw

05/02/2022, 3:47 AM
I see. I guess it would depend on the applier then. Currently the factory is synchronous. But if you control everything you could have a placeholder node which is ignored while you load the real asset. Basically the same trick as using a loading view or composable but instead supported by your node tree itself
a

andrew

05/02/2022, 3:47 PM
Gotcha, doesn't feel as elegant, but makes sense 🙂
12 Views