This repository has been archived by the owner on Aug 8, 2024. It is now read-only.
Independence day
Breaking changes
- The codebase has been migrated to Swift 2.2
Promise
now has only an emptyinit
. If you used one of the convenienceinit
(withvalue:
, witherror:
or withvalue:error:
), they now moved toFuture
.
New features
- Adds
value
anderror
properties toResult
- Added a way to initialize
Future
s through closures - It's now possible to
map
Future
s through:- a simple transformation closure
- a closure that
throws
- It's now possible to
flatMap
Future
s through:- a closure that returns an
Optional
- a closure that returns another
Future
- a closure that returns a
Result
- a closure that returns an
- It's now possible to
filter
Future
s through:- a simple condition closure
- a closure that returns a
Future<Bool>
- It's now possible to
reduce
aSequenceType
ofFuture
s into a newFuture
through acombine
closure - It's now possible to
zip
aFuture
with either anotherFuture
or with aResult
- Added
merge
to aSequenceType
ofFuture
s to collapse a list ofFuture
s into a single one - Added
traverse
toSequenceType
to generate a list ofFuture
s through a given closure andmerge
them together - Added
recover
toFuture
so that it's possible to provide a default value theFuture
can use instead of failing - It's now possible to
map
Result
s through:- a simple transformation closure
- a closure that
throws
- It's now possible to
flatMap
Result
s through:- a closure that returns an
Optional
- a closure that returns a
Future
- a closure that returns another
Result
- a closure that returns an
- It's now possible to
filter
Result
s through a simple condition closure - Added
mimic
toResult