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

refactor: added HTTPURLResponse to returned result tuple #4

Merged
merged 2 commits into from
May 23, 2022

Conversation

lukepistrol
Copy link
Owner

Before

let result = await pexels.getCuratedPhotos()

switch result {
case .failure(let error):
    print(error.description)
case .success(let (data, paging)):
    // access photos
    // data -> [PSPhoto]
    // paging -> PSPagingInfo
}

After

let result = await pexels.getCuratedPhotos()

switch result {
case .failure(let error):
    print(error.description)
case .success(let (data, paging, response)):
    // access photos
    // data -> [PSPhoto]
    // paging -> PSPagingInfo
    // response -> HTTPURLResponse
}

@lukepistrol lukepistrol added the enhancement New feature or request label May 23, 2022
@lukepistrol lukepistrol merged commit c2de009 into main May 23, 2022
@lukepistrol lukepistrol deleted the response branch May 23, 2022 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant