elizarov
06/27/2017, 8:23 AMval mapAsync = async(context, CoroutineStart.LAZY) { ... your async code here to get the map ... }
Then you’d use it like this fragment.mapAsync.await()
. It is not as clean as property delegate, but works just as fine (100% lazy and remembers the value after initialization)kevinherron
06/27/2017, 1:22 PMelizarov
06/27/2017, 2:09 PMawait
- yes. It will start this coroutine exactly once even if multiple concurrent await
are invokedkevinherron
06/27/2017, 2:19 PM