mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2025-08-04 16:39:39 +00:00
add docs to the MutableState.asState
This commit is contained in:
CHANGELOG.md
common/compose/src/commonMain/kotlin/dev/inmo/micro_utils/common/compose
@@ -7,6 +7,8 @@
|
|||||||
* `Diff` now is serializable
|
* `Diff` now is serializable
|
||||||
* Add `IndexedValue` serializer
|
* Add `IndexedValue` serializer
|
||||||
* `repeatOnFailure` extending: now you may pass any lambda to check if continue to try/do something
|
* `repeatOnFailure` extending: now you may pass any lambda to check if continue to try/do something
|
||||||
|
* `Compose`:
|
||||||
|
* New extension `MutableState.asState`
|
||||||
* `Coroutines`:
|
* `Coroutines`:
|
||||||
* `Compose`:
|
* `Compose`:
|
||||||
* `asMutableComposeState` and all depending functions now use `doInUI` to guarantee state changin in Main Dispatcher
|
* `asMutableComposeState` and all depending functions now use `doInUI` to guarantee state changin in Main Dispatcher
|
||||||
|
@@ -1,6 +1,10 @@
|
|||||||
package dev.inmo.micro_utils.common.compose
|
package dev.inmo.micro_utils.common.compose
|
||||||
|
|
||||||
import androidx.compose.runtime.MutableState
|
import androidx.compose.runtime.MutableState
|
||||||
|
import androidx.compose.runtime.State
|
||||||
import androidx.compose.runtime.derivedStateOf
|
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