Package-level declarations

Types

Link copied to clipboard
class AndroidLogger(var minLevel: Logger.Level) : Logger

A logger that use Android's Log.

Link copied to clipboard
@ExperimentalCoroutinesApi
abstract class BaseBuilder<InputState : S, S : Any, A : Any>
Link copied to clipboard

Allows to create ChangedState objects to change the state as a result of DSL methods like InStateBuilder.on or InStateBuilder.onEnter.

Link copied to clipboard
sealed class ChangedState<out S>

Represents a state transition. Instances of this a created through the ChangeableState.mutate, ChangeableState.override and ChangeableState.noChange methods.

Link copied to clipboard
@ExperimentalCoroutinesApi
class ConditionBuilder<InputState : S, S : Any, A : Any> : BaseBuilder<InputState, S, A>
Link copied to clipboard
sealed interface ExecutionPolicy

Defines which behavior a DSL Block such as on<Action> should have whenever a new action or value is emitted.

Link copied to clipboard
@ExperimentalCoroutinesApi
class FlowReduxBuilder<S : Any, A : Any>
Link copied to clipboard

A live state machine that was created by a FlowReduxStateMachineFactory. state is a container allowing either access the current state or collecting the current state. dispatchAction and dispatch can be used to send actions to the state machine.

Link copied to clipboard
abstract class FlowReduxStateMachineFactory<S : Any, A : Any>

Used to define a state machine using initializeWith and spec. It can then be started with methods like launchIn or shareIn.

Link copied to clipboard
@ExperimentalCoroutinesApi
class IdentityBuilder<InputState : S, S : Any, A : Any> : BaseBuilder<InputState, S, A>
Link copied to clipboard
@ExperimentalCoroutinesApi
class InStateBuilder<InputState : S, S : Any, A : Any> : BaseBuilder<InputState, S, A>
Link copied to clipboard
interface Logger

Provides logging capabilities for state machines.

Link copied to clipboard
interface SaveableState
Link copied to clipboard
class SimpleLogger(var minLevel: Logger.Level) : Logger

A logger that logs to stdout.

Link copied to clipboard
sealed class State<InputState : Any>

Allows access to a snapshot that can be used to access the current state at the time the action or event happened.

Functions

Link copied to clipboard
fun <S : Parcelable> FlowReduxStateMachineFactory<S, *>.initializeWith(savedStateHandle: SavedStateHandle, initialState: () -> S)

Sets the initial state for the state machine with a Parcelable state class.

fun <S : Any> FlowReduxStateMachineFactory<S, *>.initializeWith(reuseLastEmittedStateOnLaunch: Boolean = true, initialState: () -> S)

Sets the initial state for the state machine.

fun <S : SaveableState> FlowReduxStateMachineFactory<S, *>.initializeWith(savedStateHandle: SavedStateHandle, initialState: (SavedStateHandle) -> S)

Sets the initial state for the state machine with a state class that implements SaveableState. The implementation can save values of the state into the SavedStateHandle. The SavedStateHandle is passed to initialState on each state machine launch so that previously saved values, if present, can be used to construct the initial state.

inline fun <S : Any> FlowReduxStateMachineFactory<S, *>.initializeWith(savedStateHandle: SavedStateHandle, noinline initialState: () -> S)

Sets the initial state for the state machine with a kotlinx.serialization.Serializable state class.

Link copied to clipboard

Create and start running a FlowReduxStateMachine that exposes a compose State. The state machine will stay active as long as this method stays in the current composition.

Link copied to clipboard
fun <S> ChangedState<S>.reduce(state: S): S

Transforms the given state according to ChangedState and returns the new S.

Link copied to clipboard
@ExperimentalCoroutinesApi
@Composable
fun <S : Any, A : Any> stateMachine(initialState: S, specBlock: @DisallowComposableCalls FlowReduxBuilder<S, A>.() -> Unit): FlowReduxStateMachine<State<S>, A>