Promise in Java Script and UI5

1 Просмотры
promises in JS are no different than the real-life promises — when coupled with result-oriented conditions. They are used to handle asynchronous behaviours of JS.
The promise is an action that guarantees a result in the future, the result could be the expected one(positive) and if anything goes wrong, the result will be something which was not anticipated(negative). So, while doing the promise we also close on the conditions

For complete training, Mail us on contact@

Our forum:
Twitter Page:
Facebook :
Instagram :

Feel free to call us on +91 8448454549, Or mail us on contact@

You can download the ppt of this session from below

Some basics:
A promise has to has the main action, in our example, it was ‘Room Cleaning’. Technically, this main action is a function, called an executor.
Now, the executor can produce either the success or failure results. The handlers — ‘Football’ and ‘Laundry’ are the asynchronous callback functions, registered using then & catch — will see in more details.
As a developer, you first need to define the executor & handler functions.
Then promise(s) comes in to play — Promises is just the way how as developers should arrange all these dependencies in code more cleanly.
Promise(s) is a JS object provided by the standard implementation(after ES6) to arrange all these dependencies. A new promise is created using the Promise constructor.
Видео обзоры
Комментариев нет.