https://github.com/vasanthk/simple-promise-library
A simple implementation of a promise library
https://github.com/vasanthk/simple-promise-library
Last synced: about 1 year ago
JSON representation
A simple implementation of a promise library
- Host: GitHub
- URL: https://github.com/vasanthk/simple-promise-library
- Owner: vasanthk
- Created: 2015-07-09T05:17:50.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2016-02-17T17:09:28.000Z (over 10 years ago)
- Last Synced: 2024-03-15T19:10:04.955Z (over 2 years ago)
- Language: JavaScript
- Size: 5.86 KB
- Stars: 13
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Simple promise library
A simple implementation of a promise library.
This is from promises explained by Axel Rauschmayer in his article [here](http://www.2ality.com/2014/10/es6-promises-api.html)
Credit for [diagram](http://www.2ality.com/2014/10/es6-promises-api.html) and [demo code](https://github.com/rauschma/demo_promise) goes to him.
### Promise: Stand-alone

### Promise: Chaining

### Promise: Chaining + Flattened

### Promise: Chaining + Flattened

If we wanted to turn this into an actual promise implementation, we’d still need to implement the [revealing constructor pattern](https://blog.domenic.me/the-revealing-constructor-pattern/):
ES6 promises are not resolved and rejected via methods, but via functions that are handed to the executor, the callback parameter of the constructor.
#### Reference Links:
https://promisesaplus.com/
http://www.2ality.com/2014/10/es6-promises-api.html
http://www.html5rocks.com/en/tutorials/es6/promises/
https://www.promisejs.org/patterns/
http://www.html5rocks.com/en/tutorials/developertools/async-call-stack/