Skip to content Skip to sidebar Skip to footer

Coroutines And Firebase: How To Implement Javascript-like Promise.all()

In Javascript, you can start two (or more) asynchronous tasks simultaneously, wait both of them to finish and then do something/continue: const [firstReturn, secondReturn] = await

Solution 1:

You will likely want to make use of Play services integration with coroutines that's documented here. What you get from this library is an extension function for Task (returned by Play and Firebase async APIs) called await() that you can use in a coroutine to defer execution until it's done.


Post a Comment for "Coroutines And Firebase: How To Implement Javascript-like Promise.all()"