useSelector

inline fun <T> useSelector(alias: String? = null): State<T>

Use selector

Return

Parameters

T

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

data class SimpleData(
val name: String,
val age: Int,
)

//...
val age by useSelector<SimpleData, String> { "age : $age" }

Return

Receiver

Parameters

block
T
R