EmittingHandler

class EmittingHandler<A, E>(collectWithChannel: (Flow<A>, FlowCollector<E>, Job) -> Unit, flow: MutableSharedFlow<E>) : Handler<A> , Flow<E>

An EmittingHandler is a special Handler that constitutes a new Flow by itself. You can emit values to this Flow from your code and connect it to other Handlers on this or on other Stores. This way inter-store-communication is done in fritz2.

Parameters

collectWithChannel

defines how to handle the values of the connected Flow

Constructors

EmittingHandler
Link copied to clipboard
js
fun <A, E> EmittingHandler(collectWithChannel: (Flow<A>, FlowCollector<E>, Job) -> Unit, flow: MutableSharedFlow<E> = MutableSharedFlow())
defines how to handle the values of the connected Flow

Functions

collect
Link copied to clipboard
js
open suspend override fun collect(collector: FlowCollector<E>)
invoke
Link copied to clipboard
js
open operator fun invoke()
Calls this handler exactly once.
open operator fun invoke(data: A)
Calls this handler exactly once.

Properties

collect
Link copied to clipboard
js
open override val collect: (Flow<A>, Job) -> Unit
function defining how this Handler collects a Flow when connected using handledBy
collectWithChannel
Link copied to clipboard
js
val collectWithChannel: (Flow<A>, FlowCollector<E>, Job) -> Unit
defines how to handle the values of the connected Flow