Skip to content

Commit

Permalink
Merge pull request #24 from muhammadzkralla/lambda_coroutine
Browse files Browse the repository at this point in the history
Consistency In Arguments.
  • Loading branch information
muhammadzkralla authored May 15, 2024
2 parents cf67876 + 9d2f58d commit 25ca388
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion zhttp/src/main/java/com/zkrallah/zhttp/ZDelete.kt
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@ class ZDelete(val client: ZHttpClient) {
*/
inline fun <reified T> processDelete(
endpoint: String,
headers: List<Header>?,
queries: List<Query>?,
headers: List<Header>?,
crossinline onComplete: (success: Response<T>?, failure: Exception?) -> Unit
): Job {
return CoroutineScope(Dispatchers.IO).launch {
Expand Down
2 changes: 1 addition & 1 deletion zhttp/src/main/java/com/zkrallah/zhttp/ZGet.kt
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@ class ZGet(val client: ZHttpClient) {
*/
inline fun <reified T> processGet(
endpoint: String,
headers: List<Header>?,
queries: List<Query>?,
headers: List<Header>?,
crossinline onComplete: (success: Response<T>?, failure: Exception?) -> Unit
): Job {
return CoroutineScope(Dispatchers.IO).launch {
Expand Down
20 changes: 10 additions & 10 deletions zhttp/src/main/java/com/zkrallah/zhttp/ZHttpClient.kt
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,12 @@ class ZHttpClient private constructor(builder: Builder) {
*/
inline fun <reified T> get(
endpoint: String,
headers: List<Header>?,
queries: List<Query>?,
headers: List<Header>?,
noinline onComplete: (success: Response<T>?, failure: Exception?) -> Unit
): Job {
return ZGet(this).processGet(
endpoint, headers, queries, onComplete
endpoint, queries, headers, onComplete
)
}

Expand Down Expand Up @@ -134,12 +134,12 @@ class ZHttpClient private constructor(builder: Builder) {
inline fun <reified T> post(
endpoint: String,
body: Any,
headers: List<Header>?,
queries: List<Query>?,
headers: List<Header>?,
noinline onComplete: (success: Response<T>?, failure: Exception?) -> Unit
): Job {
return ZPost(this).processPost(
endpoint, body, headers, queries, onComplete
endpoint, body, queries, headers, onComplete
)
}

Expand Down Expand Up @@ -169,12 +169,12 @@ class ZHttpClient private constructor(builder: Builder) {
*/
inline fun <reified T> delete(
endpoint: String,
headers: List<Header>?,
queries: List<Query>?,
headers: List<Header>?,
noinline onComplete: (success: Response<T>?, failure: Exception?) -> Unit
): Job {
return ZDelete(this).processDelete(
endpoint, headers, queries, onComplete
endpoint, queries, headers, onComplete
)
}

Expand Down Expand Up @@ -205,12 +205,12 @@ class ZHttpClient private constructor(builder: Builder) {
inline fun <reified T> put(
endpoint: String,
body: Any,
headers: List<Header>?,
queries: List<Query>?,
headers: List<Header>?,
noinline onComplete: (success: Response<T>?, failure: Exception?) -> Unit
): Job {
return ZPut(this).processPut(
endpoint, body, headers, queries, onComplete
endpoint, body, queries, headers, onComplete
)
}

Expand Down Expand Up @@ -242,12 +242,12 @@ class ZHttpClient private constructor(builder: Builder) {
inline fun <reified T> patch(
endpoint: String,
body: Any,
headers: List<Header>?,
queries: List<Query>?,
headers: List<Header>?,
noinline onComplete: (success: Response<T>?, failure: Exception?) -> Unit
): Job {
return ZPatch(this).processPatch(
endpoint, body, headers, queries, onComplete
endpoint, body, queries, headers, onComplete
)
}

Expand Down
2 changes: 1 addition & 1 deletion zhttp/src/main/java/com/zkrallah/zhttp/ZPatch.kt
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@ class ZPatch(val client: ZHttpClient) {
inline fun <reified T> processPatch(
endpoint: String,
requestBody: Any,
headers: List<Header>?,
queries: List<Query>?,
headers: List<Header>?,
crossinline onComplete: (success: Response<T>?, failure: Exception?) -> Unit
): Job {
return CoroutineScope(Dispatchers.IO).launch {
Expand Down
2 changes: 1 addition & 1 deletion zhttp/src/main/java/com/zkrallah/zhttp/ZPost.kt
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@ class ZPost(val client: ZHttpClient) {
inline fun <reified T> processPost(
endpoint: String,
requestBody: Any,
headers: List<Header>?,
queries: List<Query>?,
headers: List<Header>?,
crossinline onComplete: (success: Response<T>?, failure: Exception?) -> Unit
): Job {
return CoroutineScope(Dispatchers.IO).launch {
Expand Down
2 changes: 1 addition & 1 deletion zhttp/src/main/java/com/zkrallah/zhttp/ZPut.kt
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@ class ZPut(val client: ZHttpClient) {
inline fun <reified T> processPut(
endpoint: String,
requestBody: Any,
headers: List<Header>?,
queries: List<Query>?,
headers: List<Header>?,
crossinline onComplete: (success: Response<T>?, failure: Exception?) -> Unit
): Job {
return CoroutineScope(Dispatchers.IO).launch {
Expand Down

0 comments on commit 25ca388

Please sign in to comment.