Skip to content

Commit 0fd9338

Browse files
committed
Migrating Context Receiver->Context Parameter
1 parent dc2c363 commit 0fd9338

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

build-logic/convention/src/main/kotlin/com/javernaut/whatthecodec/buildlogic/ProjectConfiguration.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,6 @@ private inline fun <reified T : KotlinBaseExtension> Project.configureKotlin() =
6060
}.apply {
6161
jvmTarget = Versions.kotlinJvmTarget
6262
allWarningsAsErrors = warningsAsErrors.toBoolean()
63-
freeCompilerArgs.add("-Xcontext-receivers")
63+
freeCompilerArgs.add("-Xcontext-parameters")
6464
}
6565
}

features/settings/ui/src/main/kotlin/com/javernaut/whatthecodec/feature/settings/presentation/SettingsViewModel.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ class SettingsViewModel @Inject constructor(
5555
}
5656
}
5757

58-
context(ViewModel)
58+
context(viewModel: ViewModel)
5959
fun <T> Flow<T>.stateIn(initialValue: T): StateFlow<T> {
6060
return stateIn(
61-
viewModelScope,
61+
viewModel.viewModelScope,
6262
SharingStarted.WhileSubscribed(stopTimeoutMillis = 5_000),
6363
initialValue
6464
)

0 commit comments

Comments
 (0)