Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Breaking Change] New builder pattern For Result #874

Merged
merged 3 commits into from
Jul 25, 2023
Merged

Conversation

iNoles
Copy link
Collaborator

@iNoles iNoles commented Jul 20, 2023

old way is

loader().get(
    Request.Builder()
        .url(url)
        .parameters(parameters)
        .headers(headers)
        .build()
)

new way is

loader().get {
    this.url = url
    this.parameters = parameters
    this.headers = headers
}

I think it is more simplified to cut down on verbose with more type-safe builder patterns. I am wondering if somebody may have a problem with this.

@iNoles iNoles requested a review from kittinunf July 20, 2023 04:23
@iNoles iNoles self-assigned this Jul 20, 2023
Copy link
Owner

@kittinunf kittinunf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm!!

println(string)
}

runBlocking {
val string = "https://publicobject.com/helloworld.txt".httpGet().body!!.string()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

@iNoles iNoles merged commit 530a2c2 into main Jul 25, 2023
@iNoles iNoles deleted the new-builder-pattern branch July 25, 2023 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants