Tomorrowland v0.5.0 Release Notes
Release Date: 2019-02-26 // about 5 years ago-
๐ 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 inself?.doSomething(with: value) })
๐ will raise a warning suggesting this should be
map(on:_:)
, due to the inferred()?
return type. This can be suppressed by writingvalue -> Void
as the type signature instead. A future release will remove this deprecation warning.