Join Slack
Powered by
Is there a way to connect LocalProvider with the K...
# compose
p
Piotr Prus
07/22/2021, 9:36 AM
Is there a way to connect LocalProvider with the Kotlin FLow? I am trying to change dynamically the LocalProvider with DataStore flow.
a
Albert Chang
07/22/2021, 9:38 AM
CompositionLocalProvider(LocalValue provides flow.collectAsState().value)
should work.
👍 1
p
Piotr Prus
07/22/2021, 10:42 AM
Awesome. It is working! I just needed to add initialValue in collectAsState(initialValue = “”)
3
Views
Open in Slack
Previous
Next