An Ecmascript 6 Polyfill which is strictly following specification + Extensions
npm install promise-extconsole
$ bower install promise-ext --save
`
Using NuGet:
`console
$ Install-Package PromiseExt
`
Using NPM:
`console
$ npm install promise-ext --save
`
Usage
You could use promise-ext in different context.
$3
Include built script in your HTML file.
`html
`
$3
Configure RequireJS.
`javascript
requirejs.config({
paths: {
promise: 'path/to/promise'
}
});
`
Then include promise in your dependencies.
`javascript
define(["promise"], function() {
var promise = new Promise(function(resolve, reject) {
});
});
`
$3
If you want to build using RequireJS r.js and almond along with your project, you have to add some configuration.
`javascript
{
paths: {
'promise': 'path/to/promise',
'promise-almond': 'path/to/promise-almond'
},
include: [
"path/to/promise-almond",
"path/to/promise/class",
"path/to/promise/extensions" // not mandatory if your are referencing it in your app
]
}
`
$3
Call require to register Promise to global object
`javascript
require("promise-ext");
var extensions = requrie("promise-ext/lib/promise/extensions");
var promise = new Promise(function(resolve, reject) {
});
`
Contribute
$3
Checkout repository and install dependencies
`console
$ git clone https://github.com/spatools/promise.git
$ npm install -g grunt-cli bower tsd
$ npm install
`
Documentation
You can find documentation about EcmaScript 6 Promise specification on some websites.
* Mozilla Developer Network
* HTML5Rocks
This library strictly follows EcmaScript 6 Specification which can be found on EcmaScript Wiki.
* Word
* PDF
$3
#### Test
Any changes should be tested. Any additions should have a new test associated with it.
`console
$ grunt test
`
#### Build
`console
$ grunt build
``