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

Get 3.0 #75

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Get 3.0 #75

wants to merge 2 commits into from

Conversation

kean
Copy link
Owner

@kean kean commented Feb 22, 2023

Prototype of the new Sendable-compliant APIs to address new Xcode 14.3 warnings and make the framework easier to user.

private struct User: Decodable {}

func usage() async throws {
    let client = APIClient(baseURL: nil)

    let dataTask = await client.dataTask(with: Request<User>(path: "/user"))

    if #available(iOS 15, *) {
        for await progress in dataTask.progress.values {
            print(progress)
        }
    }

    let response = try await dataTask.response.value
    let data = try await dataTask.data
    let string = try await dataTask.string
}

@kean kean force-pushed the main branch 6 times, most recently from 28fe852 to 74dba20 Compare April 13, 2024 17:39
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.

1 participant