BlocBuilder

The BlocBuilder class to build them all. This is what we use to build blocs using the BlocBuilderDsl.

It has to be a class because of the reified functions and it has to be public because it's exposed by the BlocBuilderDsl.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
fun <A : Action> addReducer(matcher: Matcher<Action, A>, reducer: Reducer<State, Action, Effect<Proposal, SE>>, expectsProposal: Boolean)

Only used internally but needs to be public because of calls from inlined public functions

Link copied to clipboard
fun <A : Action> addThunk(matcher: Matcher<Action, A>, thunk: Thunk<State, Action, A, Proposal>)

Only used internally but needs to be public because of calls from inlined public functions

Link copied to clipboard
@JvmName(name = "proposalAnd")
infix fun Proposal.and(sideEffect: SE): Effect<Proposal, SE>
@JvmName(name = "sideEffectAnd")
infix fun SE.and(proposal: Proposal): Effect<Proposal, SE>

Used in a reducer with sideEffect to return a side effect:

@JvmName(name = "sideEffectAndSideEffect")
infix fun SE.and(sideEffect: SE): List<SE>

Used in a reducer with sideEffect to return another side effect:

Link copied to clipboard

Used in a reducer with sideEffect to return state without side effect:

Link copied to clipboard

Create an initializer (onCreate { })

Link copied to clipboard
@JvmName(name = "reduceMatching")
inline fun <A : Action> reduce(noinline reducer: Reducer<State, A, Proposal>)

Create an action specific reducer (reduce { })

Create a catch-all reducer (reduce { })

@JvmName(name = "reduceMatchingEnums")
inline fun <ActionEnum : Enum<ActionEnum>, A : ActionEnum> reduce(childClazz: A, noinline reducer: Reducer<State, A, Proposal>)

Create an action specific reducer (reduce(action) { })

Link copied to clipboard

Create a catch-all reducer with side-effect(s) (reduceAnd { })

@JvmName(name = "reduceWithSideEffectMatching")
inline fun <A : Action> reduceAnd(noinline reducer: Reducer<State, Action, Effect<Proposal, SE>>)

Create an action specific reducer with side-effect(s) (reduceAnd { })

@JvmName(name = "reduceWithSideEffectMatchingEnums")
inline fun <ActionEnum : Enum<ActionEnum>, A : ActionEnum> reduceAnd(childClazz: A, noinline reducer: Reducer<State, Action, Effect<Proposal, SE>>)

Create an action specific reducer with side-effect(s) (reduceAnd(action) { })

Link copied to clipboard
@JvmName(name = "sideEffectMatching")
inline fun <A : Action> sideEffect(noinline sideEffect: SideEffect<State, A, SE>)

Create an action specific side-effect (sideEffect { })

fun sideEffect(sideEffect: SideEffect<State, Action, SE>)

Create a catch-all side-effect (sideEffect { })

@JvmName(name = "sideEffectMatchingEnums")
inline fun <ActionEnum : Enum<ActionEnum>, A : ActionEnum> sideEffect(childClazz: A, noinline sideEffect: SideEffect<State, A, SE>)

Create an action specific side-effect (sideEffect(action) { })

Link copied to clipboard
@JvmName(name = "thunkMatching")
inline fun <A : Action> thunk(noinline thunk: Thunk<State, Action, A, Proposal>)
@JvmName(name = "thunkMatchingEnums")
inline fun <ActionEnum : Enum<ActionEnum>, A : ActionEnum> thunk(childClazz: A, noinline thunk: Thunk<State, ActionEnum, A, Proposal>)

Create an action specific thunk (thunk(action) { })

Create a catch-all thunk (thunk { })

Properties

Link copied to clipboard
var dispatchers: CoroutineDispatcher
Link copied to clipboard
var initDispatcher: CoroutineDispatcher
Link copied to clipboard
var reduceDispatcher: CoroutineDispatcher
Link copied to clipboard
var thunkDispatcher: CoroutineDispatcher