Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xiaody/in-promise
A minimal Promises/A+ implementation for browsers
https://github.com/xiaody/in-promise
Last synced: 1 day ago
JSON representation
A minimal Promises/A+ implementation for browsers
- Host: GitHub
- URL: https://github.com/xiaody/in-promise
- Owner: xiaody
- Created: 2015-07-13T08:33:35.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-04-01T06:41:36.000Z (almost 8 years ago)
- Last Synced: 2024-12-16T06:02:53.247Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 57.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[![npm version](https://badge.fury.io/js/in-promise.svg)](http://badge.fury.io/js/in-promise)
[![Build Status](https://travis-ci.org/xiaody/in-promise.svg?branch=master)](https://travis-ci.org/xiaody/in-promise)
[![Codacy Badge](https://www.codacy.com/project/badge/bbeaa5c6e1964549b08f6ece3415fc76)](https://www.codacy.com/app/youyounaihe/in-promise)
[![codecov.io](http://codecov.io/github/xiaody/in-promise/coverage.svg?branch=master)](http://codecov.io/github/xiaody/in-promise?branch=master)
[![Dependency Status](https://david-dm.org/xiaody/in-promise.svg)](https://david-dm.org/xiaody/in-promise)
[![devDependency Status](https://david-dm.org/xiaody/in-promise/dev-status.svg)](https://david-dm.org/xiaody/in-promise#info=devDependencies)in-promise is a minimal Promises/A+ implementation for browsers.
~700 bytes (gzip).# API
It is really _minimal_, and only provides a ES6 style Promise constructor plus a Promises/A+ compatible `Promise#then` method:```js
var p1 = new Promise(function (res, rej) {
setTimeout(function () {
res('Hello Promise')
}, 100)
})
var p2 = p1.then(function (value) {
console.log(value) // Hello Promise
})
```This is no `Promise#catch` or `Promise.all` or `Promise.race` or ...
Just `Promise#then`.For a polyfill for ES6 Promise, check the [es6 branch].
[es6 branch]: https://github.com/xiaody/in-promise/tree/es6