This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Handles calling the Retrofit endpoints | |
* [apiCallFunc] is the Retrofit endpoint you want to call | |
* During runtime, [V] would be equal to the type wrapped by [Response] | |
* [V] is returned as the reflection would already be executed during that time | |
* giving us the contents of the inferred [V] | |
*/ | |
suspend fun <V> callAPI(apiCallFunc: suspend () -> Response<V>): V? { | |
val actsResult: Response<V>? | |
if (utils.isInternetAvailable(ctx)) { |