Package-level declarations

Types

Link copied to clipboard
data class Store

all states are finally stored to this class

Link copied to clipboard
data class StoreRecord

A state-stored record that is used to hold a single record

Link copied to clipboard

Functions

Link copied to clipboard
fun combineStores(vararg stores: Store): Store

等同于使用扩展操作符

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

A function used to construct a state Store instance, you can easily use StoreScope.with in the tail closure function to create a StoreRecord.

Link copied to clipboard
operator fun Store.plus(other: Store): Store

Store 实例的创建并不要求一次性创建,你可以创建多个Store实例,然后使用这个扩展操作符进行组合。

Link copied to clipboard
fun ReduxProvider(store: Store, content: ComposeComponent)

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

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): State<T>

Use selector

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

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