Promise/A+ is the specification what this implementation follow. It can be used in any allowed way under Promise/A+.
This implementation is quite small, and it is easy to merge into other code without introduction of redundant code. This is very helpful when developing a webapp.
- Browser support
- Nodejs
- Browser extensions
You need the necessary dependencies:
npm install
Run tests
npm test
Q(function(resolve, reject) {
// Async or sync operation
// success: resolve(val)
// error: reject(reason)
}).then(function(val) {
// onresolved
}, function(reason) {
// onrejected
});
Copyright 2015–2016 Xiao-Bo Li MIT License