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

commonMain.org.jetbrains.compose.resources.ResourceState.kt Maven / Gradle / Ivy

There is a newer version: 1.7.0-beta02
Show newest version
package org.jetbrains.compose.resources

import androidx.compose.runtime.Composable
import androidx.compose.runtime.State

/**
 * This is a platform-specific function that calculates and remembers a state.
 * For all platforms except a JS it is a blocking function.
 * On the JS platform it loads the state asynchronously and uses `getDefault` as an initial state value.
 */
@Composable
internal expect fun  rememberResourceState(
    key1: Any,
    getDefault: () -> T,
    block: suspend (ResourceEnvironment) -> T
): State

/**
 * This is a platform-specific function that calculates and remembers a state.
 * For all platforms except a JS it is a blocking function.
 * On the JS platform it loads the state asynchronously and uses `getDefault` as an initial state value.
 */
@Composable
internal expect fun  rememberResourceState(
    key1: Any,
    key2: Any,
    getDefault: () -> T,
    block: suspend (ResourceEnvironment) -> T
): State

/**
 * This is a platform-specific function that calculates and remembers a state.
 * For all platforms except a JS it is a blocking function.
 * On the JS platform it loads the state asynchronously and uses `getDefault` as an initial state value.
 */
@Composable
internal expect fun  rememberResourceState(
    key1: Any,
    key2: Any,
    key3: Any,
    getDefault: () -> T,
    block: suspend (ResourceEnvironment) -> T
): State




© 2015 - 2024 Weber Informatics LLC | Privacy Policy