Skip to content

Commit

Permalink
No longer use context receivers
Browse files Browse the repository at this point in the history
  • Loading branch information
Omico committed Sep 7, 2024
1 parent 3247225 commit 4f6f77b
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ plugins {

kotlin {
sourceSets {
all {
languageSettings {
enableLanguageFeature("ContextReceivers")
}
}
commonMain {
dependencies {
implementation(project(":wwm-core-ui"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@ import dev.omico.wwm.ui.WwmUiComponent
import dev.omico.wwm.ui.rememberUpdatedListState
import kotlinx.coroutines.launch

context(WwmUiComponent)
@Composable
internal fun produceAchievementsUiState(): AchievementsUiState {
internal fun WwmUiComponent.produceAchievementsUiState(): AchievementsUiState {
val scope = rememberCoroutineScope()
val achievements by achievementsRepository.achievements.collectAsRetainedState(initial = emptyList())
val achievementCategories
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ fun Circuit.Builder.addAchievementsFeature(): Circuit.Builder =
}
addPresenter<AchievementsScreen, AchievementsUiState> { _, _, _ ->
presenterOf {
with(LocalWwmUiComponent.current) {
produceAchievementsUiState()
}
LocalWwmUiComponent.current.produceAchievementsUiState()
}
}
}

0 comments on commit 4f6f77b

Please sign in to comment.