Package-level declarations

Types

Link copied to clipboard

Creates a Connectable that delegates connection creation to effectHandlers and the corresponding Connections.

Link copied to clipboard

A Logger that delegates all logging to a list of provided loggers. Useful if you have different types of loggers that you would like to us simultaneously while maintaining single responsibility per logger implementation

Link copied to clipboard
class FilterEffectHandler<I, O>(effectHandler: Connectable<I, O>, predicate: (I) -> Boolean) : Connectable<I, O>

Creates a Connectable that delegates to effectHandler and filters I values if the predicate returns true.

Link copied to clipboard
class MappedEffectHandler<I, O, II, OO>(effectHandler: Connectable<II, OO>, mapEffect: (I) -> II? = { null }, mapEvent: (OO) -> O? = { null }) : Connectable<I, O>

Creates a Connectable that delegates to effectHandler and maps the Effect and Events using mapEffect and mapEvent.

Link copied to clipboard

Collects events and passes them in order to a new consumer via dequeueAll.

Link copied to clipboard
class QueueingEventSubject<E>(capacity: Int) : SynchronizedObject, EventSource<E> , Consumer<E>

An EventSource that can also consume events. If it has a subscriber, events will be immediately forwarded to that subscriber. If it doesn't have a subscriber, it will queue up events (up to the maximum capacity specified in the constructor), and forward all queued events to the next subscriber. Only a single subscription at a time is permitted.

Functions

Link copied to clipboard
fun <I, O> Connectable<I, O>.exclude(vararg effects: KClass<*>): Connectable<I, O>
fun <I, O> Connectable<I, O>.exclude(effects: List<KClass<*>>): Connectable<I, O>
Link copied to clipboard
fun <I, O> Connectable<I, O>.filter(predicate: (I) -> Boolean): Connectable<I, O>
Link copied to clipboard
inline fun <I, O, II, OO> Connectable<II, OO>.mapped(noinline mapEffect: (I) -> II? = { it as? II }, noinline mapEvent: (OO) -> O? = { it as? O }): Connectable<I, O>