Skip to content

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.

2 participants