Skip to content

Instantly share code, notes, and snippets.

@eMdOS
Created May 1, 2020 23:36
Show Gist options
  • Save eMdOS/8c6ae52d357316061cb847541569dcee to your computer and use it in GitHub Desktop.
Save eMdOS/8c6ae52d357316061cb847541569dcee to your computer and use it in GitHub Desktop.
Medium: Extending the Swift's Result type
URLSession.shared
.dataTaskPublisher(for: url)
.map(\.data)
.decode(type: MoviesPage.self, decoder: JSONDecoder())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment