Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace LiveData and callbacks with flows #2

Merged
merged 1 commit into from
Sep 20, 2021
Merged

Replace LiveData and callbacks with flows #2

merged 1 commit into from
Sep 20, 2021

Conversation

fstanis
Copy link
Owner

@fstanis fstanis commented Jun 3, 2021

No description provided.

@fstanis fstanis requested a review from pfmaggi June 3, 2021 12:13
Copy link
Collaborator

@pfmaggi pfmaggi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just a question regarding the RefreshFlow, can't you use the debounce in the standard lib?

fun clearCallback()

override fun onStart(owner: LifecycleOwner) = startListening()
override fun onStop(owner: LifecycleOwner) = stopListening()
}

class ConnectivityStatusListenerImpl @Inject constructor(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a @ExperimentalCoroutinesApi


override fun onStart(owner: LifecycleOwner) = startListening()
override fun onStop(owner: LifecycleOwner) = stopListening()
fun recheckPermissions()
}

class TelephonyStatusListenerImpl @Inject constructor(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a @ExperimentalCoroutinesApi

@fstanis
Copy link
Owner Author

fstanis commented Jun 7, 2021

Unfortunately, debounce does a slightly different thing: most notably, debounce(5s) would wait 5s after an emit and then emit all subsequent emits in those 5s as a list, which means every tap on refresh is guaranteed to be delayed at least 5s. I think Kotlin/kotlinx.coroutines#1302 is what I'd need, but it's not implemented yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants