I’m playing with Jetpack DataStore, and it seems l...
# android
m
I’m playing with Jetpack DataStore, and it seems like there’s no way to synchronously get a key value? e.g. if I have access token stored in DataStore, and now I want to make a network request while already being in a Dispatchers.IO coroutine, how do I synchronously fetch my token?
The docs say
Copy code
Instead, use data.first() to access a single snapshot.
but is this efficient enough for a code path that might trigger quite often?
Or I’ll just convert Flow returned by DataStore into StateFlow (in GlobalScope?)