Skip to content

Releases: freshOS/Then

WhenAll now fails if one of the promises fails

06 Aug 09:26
Compare
Choose a tag to compare

Progress

31 Jul 18:04
Compare
Choose a tag to compare
  • progress is now available \o/
  • onError returns its own Promise
  • finally return its own Promise
  • We can now register multiple then / onError/ finally / progress blocks on the same promise.

RegisterThen

23 Apr 16:40
Compare
Choose a tag to compare

Registering a block for later

Calling then starts a promise if it is not already started.
In some cases, we only want to register some code for later.
For instance, in the case of JSON to Swift model parsing, we often want to attach parsing blocks to JSON promises, but without starting them.

In order to do that we need to use registerThen instead. It's the exact same thing as then without starting the promise right away.

let fetchUsers:Promise<[User]> = fetchUsersJSON().registerThen(parseUsersJSON)

// Here promise is not launched yet \o/

// later...
fetchUsers.then { users in
    // YAY
}

Faster Carthage updates

17 Apr 16:16
Compare
Choose a tag to compare

Adding a pre-built framework for faster Carthage updates :)