Function

valueChangeAction

Creates an RemoteAction that updates the value of a MutableRemoteState to a new RemoteState.

valueChangeAction

Source set: JvmAndAndroid
public fun <T> valueChangeAction(
    remoteState: MutableRemoteState<T>,
    updatedValue: RemoteState<T>,
): RemoteAction

Creates an RemoteAction that updates the value of a MutableRemoteState to a new RemoteState.

Example of toggling a MutableRemoteState boolean value on click:

Parameters

remoteState The mutable remote state to be updated.
updatedValue The new remote state value to apply.

Return

An RemoteAction representing the value change.

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: