MutationRef

interface MutationRef<T, S> : Actor

A reference to a Mutation for MutationKey.

Parameters

T

Type of the return value from the mutation.

S

Type of the variable to be mutated.

Properties

Link copied to clipboard
abstract val id: MutationId<T, S>

A unique identifier used for managing MutationKey.

Link copied to clipboard
abstract val state: StateFlow<MutationState<T>>

State Flow to receive the current state of the mutation.

Functions

Link copied to clipboard
abstract fun launchIn(scope: CoroutineScope): Job

Launches the actor.

Link copied to clipboard
abstract suspend fun mutate(variable: S): T

Mutates the variable.

Link copied to clipboard
abstract suspend fun mutateAsync(variable: S)

Mutates the variable asynchronously.

Link copied to clipboard
abstract suspend fun reset()

Resets the mutation state.