Promise
Basic JS Promise Implementation for funzzies Open to suggestions for improvements.
Last updated 10 years ago by awhoof .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install Promise 
SYNC missed versions from official npm registry.

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.

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)
  })

Current Tags

  • 1.0.5                                ...           latest (10 years ago)

6 Versions

  • 1.0.5                                ...           10 years ago
  • 1.0.4                                ...           10 years ago
  • 1.0.3                                ...           10 years ago
  • 1.0.2                                ...           10 years ago
  • 1.0.1                                ...           10 years ago
  • 1.0.0                                ...           10 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (2)
Dependents (0)
None

Copyright 2013 - present © cnpmjs.org | Home |