Skip to content

Commit

Permalink
Explanation + formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
fpillet committed Oct 2, 2019
1 parent 9bcb191 commit 9398059
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Combine
/*:
[Previous](@previous)
## Future and Promises
A `Publishers.Future` creates a new `Publisher` that eventually produces one value and then finishes or fails.
A `Publishers.Future` creates a new `Publisher` that eventually produces one value and then finishes, or fails.
- Allows you to call custom methods and return a Result.success or Result.failure
*/
struct User {
Expand Down Expand Up @@ -41,10 +41,10 @@ fetchUserPublisher
}
}
.map { user in user.name }
.catch({ (error) -> Just<String> in
.catch { (error) -> Just<String> in
print("Error occurred: \(error)")
return Just("Not found")
})
}
.sink { result in
print("User is \(result)")
}
Expand Down

0 comments on commit 9398059

Please sign in to comment.