Skip to content
This repository has been archived by the owner on Aug 2, 2024. It is now read-only.

Latest commit

 

History

History
29 lines (21 loc) · 616 Bytes

MIGRATING.md

File metadata and controls

29 lines (21 loc) · 616 Bytes

Migrating from 0.7 to 0.8

Promise now has only an empty init.

If you used one of the convenience init (with value:, with error: or with value:error:), they now moved to Future.

// Before
let future = Promise(value: 10).future

// Now
let future = Future(10)
// Before
let future = Promise(error: MyError.SomeError).future

// Now
let future = Future(MyError.SomeError)
// Before
let future = Promise(value: someOptionalInt, error: MyError.InvalidConversion).future

// Now
let future = Future(value: someOptionalInt, error: MyError.InvalidConversion)