remember

inline fun <T> remember(calculation: () -> 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.

inline fun <T, V1> remember(v1: V1, calculation: () -> T): T

Remember the value returned by calculation if v1 is equal to the previous composition, otherwise produce and remember a new value by calling calculation.

inline fun <T, V1, V2> remember(v1: V1, v2: V2, calculation: () -> T): T

Remember the value returned by calculation if v1 and v2 are equal to the previous composition, otherwise produce and remember a new value by calling calculation.

inline fun <T, V1, V2, V3> remember(v1: V1, v2: V2, v3: V3, calculation: () -> T): T

Remember the value returned by calculation if v1, v2 and v3 are equal to the previous composition, otherwise produce and remember a new value by calling calculation.

inline fun <V> remember(vararg inputs: Any?, calculation: () -> V): V

Remember the value returned by calculation if all values of inputs are equal to the previous composition, otherwise produce and remember a new value by calling calculation.