Skip to content

Commit

Permalink
Add subtypeEffectHandler overload without execution policy
Browse files Browse the repository at this point in the history
  • Loading branch information
DrewCarlson committed Jan 22, 2024
1 parent b8c8579 commit 6132bf5
Showing 1 changed file with 8 additions and 1 deletion.
Expand Up @@ -6,13 +6,20 @@ import kotlin.reflect.KClass
import kotlin.reflect.cast

public fun <F : Any, E> subtypeEffectHandler(
executionPolicy: ExecutionPolicy = ExecutionPolicy.Concurrent,
executionPolicy: ExecutionPolicy,
block: SubtypeEffectHandlerBuilder<F, E>.() -> Unit
): FlowTransformer<F, E> =
SubtypeEffectHandlerBuilder<F, E>(executionPolicy)
.apply(block)
.build()

public fun <F : Any, E> subtypeEffectHandler(
block: SubtypeEffectHandlerBuilder<F, E>.() -> Unit
): FlowTransformer<F, E> =
SubtypeEffectHandlerBuilder<F, E>(ExecutionPolicy.Concurrent)
.apply(block)
.build()

private val NOOP_COLLECTOR: suspend FlowCollector<Nothing>.(effect: Any) -> Unit = {}

public class SubtypeEffectHandlerBuilder<F : Any, E>(
Expand Down

0 comments on commit 6132bf5

Please sign in to comment.