class FetchResponse<FETCH_RESPONSE : Any>
When a OnlineRepository.fetchFreshData task is performed, Teller needs to know if the fetch request is considered to be a success or a failure.
class ResponseFail : Throwable |
val data: FETCH_RESPONSE? |
|
val failure: Throwable? |
fun isFailure(): Boolean |
|
fun isSuccessful(): Boolean |
fun <FETCH_RESPONSE : Any> fail(message: String): FetchResponse<FETCH_RESPONSE> fun <FETCH_RESPONSE : Any> fail(throwable: Throwable): FetchResponse<FETCH_RESPONSE> |
|
fun <FETCH_RESPONSE : Any> success(data: FETCH_RESPONSE): FetchResponse<FETCH_RESPONSE> |