onSuccess

inline fun onSuccess(action: (T) -> Unit): BleResult<T>

Performs the given action if this is a Success.

Returns this for chaining.

result
.onSuccess { data -> saveToDatabase(data) }
.onFailure { error -> logError(error) }

Return

This BleResult for chaining.

Parameters

action

The action to perform with the success value.