Tomorrowland v0.5.0 Release Notes

Release Date: 2019-02-26 // about 5 years ago

    ๐Ÿ“‡ Rename a lot of methods on Promise and TokenPromise (#5).

    ๐Ÿšš This gets rid of most overrides, leaving the only overridden methods to be ones that handle either Swift.Error or E: Swift.Error, and even these overrides are removed in the Swift 5 compiler.

    then is now map or flatMap, recover's override is now flatMapError, always's override is now flatMapResult, and similar renames were made for the try variants.

    โž• Add a new then method whose block returns Void. The returned promise resolves to the same result as the original promise.

    โž• Add new mapError and tryMapError methods.

    โž• Add new mapResult and tryMapResult methods.

    Extend tryFlatMapError to be available on all Promises instead of just those whose error type is Swift.Error.

    โœ‚ Remove the default .auto value for the on 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 writing value -> Void as the type signature instead. A future release will remove this deprecation warning.