onSuccess

open fun onSuccess(block: (T) -> Unit): KthResult<T, E>

Executes a block of code when the result is Success, otherwise does nothing.

Parameters

block

The block to execute.