Skip to content

Instantly share code, notes, and snippets.

@nanlabsweb
Created April 5, 2018 16:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nanlabsweb/f5b8f318acb9de923e7d00ba492d0c12 to your computer and use it in GitHub Desktop.
Save nanlabsweb/f5b8f318acb9de923e7d00ba492d0c12 to your computer and use it in GitHub Desktop.
Sync repository with coroutines.
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