onSuccess

fun <T> DataResult<T>.onSuccess(action: (T) -> Unit): DataResult<T>

Executes an action if the result is Success, without modifying the original value.

Return

The same DataResult for chaining.

Parameters

action

Action to execute on the Success value.