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

Remove default params to flow extensions #3489

Merged
merged 2 commits into from Sep 29, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -58,7 +58,7 @@ fun <T : Any> Query<T>.asFlow(): Flow<Query<T>> = flow {

@JvmOverloads
fun <T : Any> Flow<Query<T>>.mapToOne(
context: CoroutineContext = Dispatchers.Default,
context: CoroutineContext,
): Flow<T> = map {
withContext(context) {
it.awaitAsOne()
Expand All @@ -68,7 +68,7 @@ fun <T : Any> Flow<Query<T>>.mapToOne(
@JvmOverloads
fun <T : Any> Flow<Query<T>>.mapToOneOrDefault(
defaultValue: T,
context: CoroutineContext = Dispatchers.Default,
context: CoroutineContext,
): Flow<T> = map {
withContext(context) {
it.awaitAsOneOrNull() ?: defaultValue
Expand All @@ -77,7 +77,7 @@ fun <T : Any> Flow<Query<T>>.mapToOneOrDefault(

@JvmOverloads
fun <T : Any> Flow<Query<T>>.mapToOneOrNull(
context: CoroutineContext = Dispatchers.Default,
context: CoroutineContext,
): Flow<T?> = map {
withContext(context) {
it.awaitAsOneOrNull()
Expand All @@ -86,7 +86,7 @@ fun <T : Any> Flow<Query<T>>.mapToOneOrNull(

@JvmOverloads
fun <T : Any> Flow<Query<T>>.mapToOneNotNull(
context: CoroutineContext = Dispatchers.Default,
context: CoroutineContext,
): Flow<T> = mapNotNull {
withContext(context) {
it.awaitAsOneOrNull()
Expand All @@ -95,7 +95,7 @@ fun <T : Any> Flow<Query<T>>.mapToOneNotNull(

@JvmOverloads
fun <T : Any> Flow<Query<T>>.mapToList(
context: CoroutineContext = Dispatchers.Default,
context: CoroutineContext,
): Flow<List<T>> = map {
withContext(context) {
it.awaitAsList()
Expand Down