CocoaPods trunk is moving to be read-only. Read more on the blog, there are 18 months to go.

Andrew Carter

1pod

PinkyPromise

PinkyPromise is a lightweight tool for coordinating asynchronous code.

It consists mainly of a Promise type, which represents a task, and a Result type, which represents success or failure. These are immutable values that can be transformed in functional style.

Result encodes the return-or-throw pattern common in synchronous code such that asynchronous completion blocks can use that pattern, with a much tighter contract than (AnyObject?, ErrorType?) -> Void.

Promise separates the events of creating an asynchronous operation with arguments, and starting it with a completion block. Since it is a value, you can add more steps by making composite Promises.

PinkyPromise is worth using if you don't want a complex framework or if you're just getting started with functional patterns. A suitable step up from PinkyPromise is RxSwift's Observables.

License: MIT

  • Swift