Skip to content

Daring Dassie

Latest
Compare
Choose a tag to compare
@mudge mudge released this 07 Nov 15:09

Pacta now complies with the ECMAScript 2015 Promise specification meaning the addition of the following functions:

  • new Promise(executor);
  • Promise#catch(onRejected);
  • Promise.resolve(value);
  • Promise.reject(reason);
  • Promise.all(iterable);
  • Promise.race(iterable).

The API should otherwise be entirely backward-compatible with previous versions of Pacta. This new, higher-level API is implemented in terms of the existing algebraic primitives such as map, onRejected, append, etc.

mapError has been removed from the documentation as it can be implemented purely in terms of onRejected but is still available.

onRejected now propagates resolved values (similar to the way map propagates rejected ones) so that it can be more easily chained.

Install the latest version via npm or bower:

$ npm install pacta
$ bower install pacta