v0.5.0
-
Rename a lot of methods on
Promise
andTokenPromise
(#5).This gets rid of most overrides, leaving the only overridden methods to be ones that handle either
Swift.Error
orE: Swift.Error
, and even these overrides are removed in the Swift 5 compiler.then
is nowmap
orflatMap
,recover
's override is nowflatMapError
,always
's override is nowflatMapResult
, and similar renames were made for thetry
variants. -
Add a new
then
method whose block returnsVoid
. The returned promise resolves to the same result as the original promise. -
Add new
mapError
andtryMapError
methods. -
Add new
mapResult
andtryMapResult
methods. -
Extend
tryFlatMapError
to be available on allPromise
s instead of just those whose error type isSwift.Error
. -
Remove the default
.auto
value for theon context:
parameter to most calls. It's now only provided for the "terminal" callbacks, the ones that don't return a value from the handler. This avoids the common problem of running trivial maps on the main thread unnecessarily (#33).
Note: When upgrading to this version from previous versions, expect a lot of deprecation warnings. Not all of the warnings are accurate. In particular, code that looks like
somePromise().then({ [weak self] value in
self?.doSomething(with: value)
})
will raise a warning suggesting this should be map(on:_:)
, due to the inferred ()?
return type. This can be suppressed by writing value -> Void
as the type signature instead. A future release will remove this deprecation warning.