All Downloads are FREE. Search and download functionalities are using the official Maven repository.

nonAndroidMain.dev.stateholder.extensions.CollectAsState.nonAndroid.kt Maven / Gradle / Ivy

Go to download

A simple library for managing state in Kotlin Multiplatform projects, using Kotlin Coroutines and `StateFlow`.

There is a newer version: 1.2.0
Show newest version
package dev.stateholder.extensions

import androidx.compose.runtime.Composable
import androidx.compose.runtime.State
import androidx.compose.runtime.collectAsState
import com.arkivanov.essenty.lifecycle.Lifecycle
import dev.stateholder.StateOwner
import kotlin.coroutines.CoroutineContext

@Composable
public actual fun  StateOwner.collectAsState(
    minActiveState: Lifecycle.State,
    context: CoroutineContext,
): State {
    return state.collectAsState(context = context)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy