pro

Promise

Basic JS Promise Implementation for funzzies

Showing:

Popularity

Downloads/wk

440

GitHub Stars

3

Maintenance

Last Commit

5yrs ago

Contributors

1

Package

Dependencies

1

Size (min+gzip)

0.8KB

License

ISC

Type Definitions

Tree-Shakeable

No?

Categories

Readme

Promise-lite

Basic JS Promise Implementation for funzzies Open to suggestions for improvements.

Npm Module

Install

  $ npm install -S Promise

ES6+

  import Promise from 'Promise'

ES5

  var Promise = require('Promise').default

About

Supports

.then chaining and async resolution/rejection.

returning of new promise chains in a .then, and forceful unwrapping to keep the chaining flat.

TODO:

better rejection error handling

Development

Install

  $ git clone <project>
  $ npm install
  $ npm run dev //edit src folder

Build

  $ npm run build

Example

  import Promise from 'Promise'

  const p = new Promise((resolve, reject) => {
      setTimeout(() => resolve(5), 1000)
  })
  .then((fulfilled) => {
    console.log('fulfilled', fulfilled)
    return "success"
  }, (rejected) => {
    console.log('rejected ', rejected)
  })
  .then((fulfilled) => {
    console.log('fulfilled 2 ', fulfilled)
  }, (rejected) => {
    console.log('rejected 2 ', rejected)
  })

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial