Some even say that Promises can be seen as the asynchronous version of “try-catch” blocks.
A promise has only three states, pending, resolved or rejected.
Several scenarios were implemented, to try to handle issues like:
- Handling Promises as objects;
- Handling resolved or rejected promises;
- Chaining promises;
- Changing successes into failures (check weather API scenario);
- Assigning multiple “callbacks” to a single promise;
- Handling asynchronous mayhem (what order things come back);
- Controlling interdependent promises;
BootstrapJS was applied for visual enhancement.
In order to create the several scenarios in the application some API’s were used:
- Google Maps Geocoding
- Open Notify
- Speech Synthesis Utterance
- Navigator (GetBattery Method)
You can see a running demo of this project in the following link:
Link for Github Repo