Skip to content

Instantly share code, notes, and snippets.

@tdcolvin
Last active January 19, 2024 16:30
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 tdcolvin/5f0387d80f196191008d150c834312b7 to your computer and use it in GitHub Desktop.
Save tdcolvin/5f0387d80f196191008d150c834312b7 to your computer and use it in GitHub Desktop.
suspend fun deleteAllNotes() = withContext(...) {
// Create a scope. The suspend function will return when *all* the
// scope's child coroutines finish.
coroutineScope {
launch { remoteDataSource.deleteAllNotes() }
launch { localDataSource.deleteAllNotes() }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment