Created
April 5, 2018 16:16
-
-
Save nanlabsweb/f5b8f318acb9de923e7d00ba492d0c12 to your computer and use it in GitHub Desktop.
Sync repository with coroutines.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
suspend fun syncPets() { | |
val pets = firestoreWrapper.getAllPets() | |
appDataBase.petDao().deleteAllPets() | |
pets.forEach { | |
appDataBase.petDao().insert(it) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment