failure

fun <T> failure(error: Throwable, errorUpdatedAt: Long = epoch()): MutationState<T>

Creates a new MutationState with the MutationStatus.Failure status.

Parameters

error

The error that occurred.

errorUpdatedAt

The timestamp when the error occurred. Default is the current epoch.


fun <T> failure(error: Throwable, errorUpdatedAt: Long = epoch(), data: T, dataUpdatedAt: Long = epoch(), mutatedCount: Int = 1): MutationState<T>

Creates a new MutationState with the MutationStatus.Failure status.

Parameters

error

The error that occurred.

errorUpdatedAt

The timestamp when the error occurred. Default is the current epoch.

data

The data to be stored in the state.

dataUpdatedAt

The timestamp when the data was updated. Default is the current epoch.

mutatedCount

The number of times the data was mutated.