use Selector
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" }
Content copied to clipboard
Return
Receiver
Parameters
block
T
R