Open dri94 opened 5 years ago
Any feedback on this?
@Draketheb4dass you can hack it yourself for now using Kotlin's deferred statements
Can you please elaborate? some piece of code would be appreciated
I don't use shopify for anything anymore. A generic pseudocode example would be
suspend fun getListOfProducts() : Result<List<Product>, Exception> {
val deferred = CompleteableDeferred<Result<List<Product>, Exception>>()
shopifyClient.getProducts(object : Callback {
onSuccess(products: List<Product>) {
deferred.complete(Result.Success(products))
}
onError(exception: Exception) {
deferred.complete(Result.Error(exception))
}
}
retun deferred.await()
}
I'll look into it, thanks so much.
Synchronous graph calls were taken out of 3.3. In 3.2 would could use
graphClient.queryGraph(query).execute()
however this has now been removed. Allowing these calls should be left up to the developers, and not dictated. Especially since the library was converted to Kotlin. Forcing them to be async means we cannot take advantage of Kotlin Coroutines for example. Limiting the developers ability to use language features should never be implemented directly into an sdk.