Package-level declarations

Types

Link copied to clipboard
typealias DispatchAsync<A> = (block: suspend CoroutineScope.(Dispatch<A>) -> A) -> Unit
Link copied to clipboard
data class Store(val middlewares: Array<Middleware<Any, Any>>, val records: List<StoreRecord>)
Link copied to clipboard

Properties

Link copied to clipboard

Redux context

Functions

Link copied to clipboard
fun createStore(middlewares: Array<Middleware<Any, Any>> = emptyArray(), fn: StoreScope.() -> Unit): Store

Create store

Link copied to clipboard
operator fun Store.plus(other: Store): Store
Link copied to clipboard
fun ReduxProvider(store: Store, content: @Composable () -> Unit)

Redux provider, you should provide a state store to this Provider by use createStore

Link copied to clipboard
fun registerErr(target: String): Nothing
Link copied to clipboard
inline fun <A> useDispatch(alias: String? = null): Dispatch<A>

Use dispatch, Through this hook, you can easily obtain the global dispatch function

Link copied to clipboard
inline fun <A> useDispatchAsync(alias: String? = null, noinline onBefore: DispatchCallback<A>? = null, noinline onFinally: DispatchCallback<A>? = null): DispatchAsync<A>

Get a dispatch function that supports asynchronous execution. This function receives a suspend function whose return value is Action as a parameter.

Link copied to clipboard
inline fun <T> useSelector(alias: String? = null): T

Use selector

inline fun <T, R> useSelector(alias: String? = null, block: T.() -> R): R

Use selector, by pass block, you can also select part of state class,to use in your component