Avoiding a race conditions between two coroutine operations
I have two operations that are done using corroutines. Fetching from a preferences Datastore, and making an api (retrofit) call. The network call is dependent on knowing what type of Unit the user prefers (Fahrenheit, Celsius), so I need to get this data first before launching the network call.
I am not sure if I am creating a race condition here or if calling the suspend function like shown below is always going to follow the correct call order.
private suspend fun getUnits(): Units {...