mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2025-09-07 09:09:26 +00:00
add docs to the MutableState.asState
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
package dev.inmo.micro_utils.common.compose
|
||||
|
||||
import androidx.compose.runtime.MutableState
|
||||
import androidx.compose.runtime.State
|
||||
import androidx.compose.runtime.derivedStateOf
|
||||
|
||||
fun <T> MutableState<T>.asState() = derivedStateOf { this.value }
|
||||
/**
|
||||
* Converts current [MutableState] to immutable [State] using [derivedStateOf]
|
||||
*/
|
||||
fun <T> MutableState<T>.asState(): State<T> = derivedStateOf { this.value }
|
||||
|
Reference in New Issue
Block a user