Builder

class Builder<T>(initialState: T, validator: StateValidator<T>)

Builder for creating EventDrivenStateContainer instances with multiple event handlers.

Constructors

Link copied to clipboard
constructor(initialState: T, validator: StateValidator<T>)

Functions

Link copied to clipboard

Adds an event handler for the specified event type using reified generics.

Adds an event handler for the specified event type.

Link copied to clipboard

Builds the EventDrivenStateContainer with the configured handlers.

Link copied to clipboard
inline fun <E : StateEvent> onTransform(noinline transform: (T, E) -> T): EventDrivenStateContainer.Builder<T>

Adds an event handler that transforms the current state using reified generics.

fun <E : StateEvent> onTransform(eventClass: KClass<E>, transform: (T, E) -> T): EventDrivenStateContainer.Builder<T>

Adds an event handler that transforms the current state.

Link copied to clipboard

Adds an event handler that always transitions to a specific state using reified generics.

Adds an event handler that always transitions to a specific state.