Teapot
Teapot copied to clipboard
Request For Feedback: Swift 5 `Result` type
Should we consider adopting the Swift 5 Result
type instead of rolling our own NetworkResult
?
Might be nice to use generics instead of a separate result type for images as well.
COMMENTS FIIIIIIIIIIGHT!
I think this could be a good idea. There are some affordances for transforming Result
in Swift 5 that could be really useful to callers, and I feel like if there's a standard lib way of doing something extremely similar to what we're already doing, we should probably use that instead of a custom one.
@Elland @csdodd @yuliaveres thoughts?
agree to what @designatednerd says. Would be good to explore Result
.
I am afraid there will be no comments fight. Looks like Result
can easily be swapped in and I don't see any disadvantages of doing so.
🙃 Y'all are no fun whatsoever.
I'll try to work on a PR for this either today or Monday.
Not sooo sure about easily swapped in, without losing some information. I think the solution for that might be to expand TeapotError
to include the results, request data, etc as well.