Package com.episode6.redux.sideeffects

Types

Link copied to clipboard
fun interface SideEffect<State>

SideEffects offer a way to include managed async operations in a StoreFlow. The primary input is SideEffectContext.actions, which will receive an emission for every Action dispatched to the Store. The SideEffect returns a new Flow of Action which will subsequently be dispatched back into the Store.

Link copied to clipboard
interface SideEffectContext<State>

The receiver passed to a SideEffect. The primary input is actions, however we the currentState can also be captured at any time inside the SideEffect.

Functions

Link copied to clipboard
fun <State> SideEffectMiddleware(vararg sideEffects: SideEffect<State>): Middleware<State>
fun <State> SideEffectMiddleware(sideEffects: Collection<SideEffect<State>>): Middleware<State>

Returns a Middleware that passes actions to the supplied sideEffects, then dispatches their returned Actions back into the StoreFlow