Skip to content

Commit

Permalink
Remove the intent param from Compositor.composite (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
eygraber authored Mar 21, 2024
1 parent 5b8b456 commit ebb5892
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
package com.eygraber.vice

import androidx.compose.runtime.Composable
import kotlinx.coroutines.flow.Flow

public abstract class ViceCompositor<Intent, State> {
@Composable
internal fun internalComposite(intents: Flow<Intent>): State = composite(intents)

@Composable
protected abstract fun composite(intents: Flow<Intent>): State
public abstract fun composite(): State

internal suspend fun internalOnIntent(intent: Intent) = onIntent(intent)
protected open suspend fun onIntent(intent: Intent) {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ private inline fun <I, S> ViceUdf(
) {
effects.Launch()

val state = compositor.internalComposite(intents)
val state = compositor.composite()
val intentHandler: (I) -> Unit = remember(scope, compositor, intents) {
{ intent: I ->
// this is synchronous because the dispatcher is Main.immediate
Expand Down

0 comments on commit ebb5892

Please sign in to comment.