Skip to content

Instantly share code, notes, and snippets.

@saqib-github-commits
Created April 25, 2023 17:01
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 saqib-github-commits/d6a6b0d8caaf98a9cf99cc9bbcb5ee88 to your computer and use it in GitHub Desktop.
Save saqib-github-commits/d6a6b0d8caaf98a9cf99cc9bbcb5ee88 to your computer and use it in GitHub Desktop.
lifecycleScope.launch {
repeatOnLifecycle(Lifecycle.State.RESUMED) {
FirebaseDatabaseCallbackFlow.readFirebaseRealtimeDatabaseFlow()
.catch {
Log.d(TAG,"exception $it")
}.collect {
Log.d(TAG, "read value $it")
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment