fold

inline fun <T, R> AdaptyResult<T>.fold(onSuccess: (T) -> R, onError: (AdaptyError) -> R): R

Transforms the AdaptyResult into a value of type R using onSuccess if successful or onError if it is an error.