Package-level declarations

Types

Link copied to clipboard
abstract class BaseCoThunk<State>(block: suspend DispatchScope<State>.() -> Unit) : CoThunk<State>

A CoThunk implementation that executes a block.

Link copied to clipboard
abstract class BaseThunk<State>(block: DispatchScope<State>.() -> Unit) : Thunk<State>

A Thunk implementation that executes a block.

Link copied to clipboard

It is very similar to Thunk, however execute suspends. It should be used to perform asynchronous logic. Important: It is a ForegroundJobAction and thunkMiddleware is responsible for launching foreground coroutine.

Link copied to clipboard
interface Thunk<State> : ThunkMarker<State>

It is an equivalent of Redux thunk. In ReduKt it is an Action that contains some logic in execute method. It can interact with a store through DispatchScope.

Link copied to clipboard
interface ThunkMarker<State> : Action

Marker interface for every thunk.

Functions

Link copied to clipboard
inline fun <State> CoThunk(crossinline block: suspend DispatchScope<State>.() -> Unit): CoThunk<State>

Returns a CoThunk that executes a block.

Link copied to clipboard
inline fun <State> Thunk(crossinline block: DispatchScope<State>.() -> Unit): Thunk<State>

Returns a Thunk that executes a block.

Properties

Link copied to clipboard

Consumes every thunk and executes it. If action is a CoThunk, it is executed in a foreground coroutine.