Skip to content

Commit

Permalink
Merge pull request #30 from yurushao/patch-1
Browse files Browse the repository at this point in the history
Update README.md
  • Loading branch information
jparise authored Aug 18, 2020
2 parents ee946b4 + 841f523 commit ba60d97
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ PINFuture<NSNumber *> fibonacciResultFuture = [PINFuture<NSNumber *> executor:[P
In order to achieve type safety for an operation like `map` that converts from one type of value to another type, we have to jump through some hoops because of Objective-C's rudimentary support for generics. `map` and `flatMap` are class methods on the class `PINFutureMap`. The `PINFutureMap` class has two type parameters: `FromType` and `ToType`.
#### Error handling with transformations
- `map` and `flatMap` only preform a transformation is the source Future is *fulfilled*. If the source Future is *rejected*, then the original error is simply passed through to the return value.
- `mapError` and `flatMapError` only preform a transformation is the source Future is *rejected*. If the source Future is *fulfilled*, then the original value is simply passed through to the return value.
- `map` and `flatMap` only preform a transformation if the source Future is *fulfilled*. If the source Future is *rejected*, then the original error is simply passed through to the return value.
- `mapError` and `flatMapError` only preform a transformation if the source Future is *rejected*. If the source Future is *fulfilled*, then the original value is simply passed through to the return value.
#### `map`
```objc
Expand Down

0 comments on commit ba60d97

Please sign in to comment.