Composable Function

remember

Remember the value produced by calculation.

remember

Source set: Common
@Composable
public inline fun <T> remember(crossinline calculation: @DisallowComposableCalls () -> T): T

Remember the value produced by calculation. calculation will only be evaluated during the composition. Recomposition will always return the value produced by composition.

remember

Source set: Common
@Composable
public inline fun <T> remember(
    key1: Any?,
    crossinline calculation: @DisallowComposableCalls () -> T,
): T

Remember the value returned by calculation if key1 compares equal (==) to the value it had in the previous composition, otherwise produce and remember a new value by calling calculation.

remember

Source set: Common
@Composable
public inline fun <T> remember(
    key1: Any?,
    key2: Any?,
    crossinline calculation: @DisallowComposableCalls () -> T,
): T

Remember the value returned by calculation if key1 and key2 are equal (==) to the values they had in the previous composition, otherwise produce and remember a new value by calling calculation.

remember

Source set: Common
@Composable
public inline fun <T> remember(
    key1: Any?,
    key2: Any?,
    key3: Any?,
    crossinline calculation: @DisallowComposableCalls () -> T,
): T

Remember the value returned by calculation if key1, key2 and key3 are equal (==) to values they had in the previous composition, otherwise produce and remember a new value by calling calculation.

remember

Source set: Common
@Composable
public inline fun <T> remember(
    vararg keys: Any?,
    crossinline calculation: @DisallowComposableCalls () -> T,
): T

Remember the value returned by calculation if all values of keys are equal (==) to the values they had in the previous composition, otherwise produce and remember a new value by calling calculation.

Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: