SubtypeEffectHandlerBuilder

class SubtypeEffectHandlerBuilder<F : Any, E>(defaultExecutionPolicy: ExecutionPolicy)

Constructors

Link copied to clipboard
constructor(defaultExecutionPolicy: ExecutionPolicy)

Functions

Link copied to clipboard
inline fun <G : F> addAction(crossinline effectHandler: suspend () -> Unit)

Actions do not receive the Effect instant and do not return any Events using the defaultExecutionPolicy.

inline fun <G : F> addAction(executionPolicy: ExecutionPolicy, crossinline effectHandler: suspend () -> Unit)

Actions do not receive the Effect instant and do not return any Events.

Link copied to clipboard
inline fun <G : F> addConsumer(crossinline effectHandler: suspend (effect: G) -> Unit)

Receives one Effect and does not return any Events using the defaultExecutionPolicy.

inline fun <G : F> addConsumer(executionPolicy: ExecutionPolicy, crossinline effectHandler: suspend (effect: G) -> Unit)

Receives one Effect and does not return any Events.

Link copied to clipboard
inline fun <G : F> addFunction(crossinline effectHandler: suspend (effect: G) -> E)

Receives one Effect and returns exactly one Event using the defaultExecutionPolicy.

inline fun <G : F> addFunction(executionPolicy: ExecutionPolicy, noinline effectHandler: suspend (effect: G) -> E)

Receives one Effect and returns exactly one Event.

Link copied to clipboard
inline fun <G : F> addTransformer(noinline effectHandler: (input: Flow<G>) -> Flow<E>)

Provides the Flow of Effects and returns a Flow of Events. This method is unaffected by ExecutionPolicys, allowing you to provide custom behavior directly to the flow.

Link copied to clipboard
inline fun <G : F> addValueCollector(executionPolicy: ExecutionPolicy = defaultExecutionPolicy, crossinline effectHandler: suspend FlowCollector<E>.(G) -> Unit)

Using the FlowCollector builder lambda effectHandler, receives an Effect instance and allows emitting any number of Events.

Link copied to clipboard
Link copied to clipboard
inline fun <G : F> ignore()

Ignore this type of Effect, preventing errors for unhandled Effects.