parole
Another ES6 promise implementation (compliant with Promises/A+)
Last updated 3 years ago by jgermade .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install parole 
SYNC missed versions from official npm registry.

Parole

Promises/A+ logo

Another ES6 promise implementation (compliant with Promises/A+)

ᴋɪʟᴛ ᴊs npm Build Status codecov GitHub license

Installation

npm install parole

# alternatively you can use bower (minified version by default)
yarn add parole

ES6 fulfill

Parole implements ES6 Promise specs

Implements:

  • Promise.prototype.then
  • Promise.prototype.catch
  • Promise.prototype.finally

Also static methods

  • Promise.resolve
  • Promise.reject
  • Promise.all
  • Promise.allSettled
  • Promise.any
  • Promise.race

Includes:

  • Promise.defer
// parole respects the es6 promise specification
// you can use parole as global polyfill

if( !window.Promise ) {
  window.Promise = Parole;
}

Example

new Parole((resolve, reject) => {
    resolve('gogogo!')
  })

  .then((result) => {
    console.log('checkpoint 1', result)
    throw 'whoops!'
  })

  .then(
    (result) => {
      console.log('checkpoint 2', result)
    },
    (result) => {
      console.log('checkpoint 2.1', result)
      return new Parole((resolve, reject) => {
        setTimeout(() => resolve('all right!'), 400)
      })
    },
  )

  .then(
    (result) => console.log('checkpoint 3', result),
    (reason) => console.log('checkpoint 3.1', reason),
  )
;

output

checkpoint 1 gogogo!
checkpoint 2.1 whoops!
# elapsed 400ms
checkpoint 3 all right!

Current Tags

  • 2.0.28                                ...           latest (3 years ago)

46 Versions

  • 2.0.28                                ...           3 years ago
  • 2.0.27                                ...           3 years ago
  • 2.0.26                                ...           4 years ago
  • 2.0.25                                ...           4 years ago
  • 2.0.24                                ...           4 years ago
  • 2.0.23                                ...           4 years ago
  • 2.0.22                                ...           4 years ago
  • 2.0.20                                ...           4 years ago
  • 2.0.15                                ...           4 years ago
  • 2.0.14                                ...           4 years ago
  • 2.0.12                                ...           4 years ago
  • 2.0.11                                ...           4 years ago
  • 2.0.10                                ...           4 years ago
  • 2.0.9                                ...           4 years ago
  • 2.0.8                                ...           4 years ago
  • 2.0.7                                ...           4 years ago
  • 2.0.6                                ...           4 years ago
  • 2.0.5                                ...           4 years ago
  • 2.0.4                                ...           4 years ago
  • 2.0.3                                ...           4 years ago
  • 2.0.2                                ...           4 years ago
  • 2.0.1                                ...           4 years ago
  • 2.0.0                                ...           4 years ago
  • 1.1.30                                ...           8 years ago
  • 1.1.29                                ...           8 years ago
  • 1.1.24                                ...           8 years ago
  • 1.1.23                                ...           8 years ago
  • 1.1.22                                ...           8 years ago
  • 1.1.21                                ...           8 years ago
  • 1.1.20                                ...           8 years ago
  • 1.1.19                                ...           8 years ago
  • 1.1.18                                ...           8 years ago
  • 1.1.17                                ...           9 years ago
  • 1.1.16                                ...           9 years ago
  • 1.1.14                                ...           9 years ago
  • 1.1.11                                ...           9 years ago
  • 1.1.10                                ...           9 years ago
  • 1.1.9                                ...           9 years ago
  • 1.1.8                                ...           9 years ago
  • 1.1.7                                ...           9 years ago
  • 1.1.5                                ...           10 years ago
  • 1.1.4                                ...           10 years ago
  • 1.1.3                                ...           10 years ago
  • 1.1.2                                ...           10 years ago
  • 1.0.1                                ...           10 years ago
  • 1.0.0                                ...           10 years ago
Maintainers (1)
Downloads
Total 54
Today 0
This Week 1
This Month 54
Last Day 0
Last Week 53
Last Month 0
Dependencies (0)
None
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE