Promise in Java Script and UI5

preview_player
Показать описание
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

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.
Рекомендации по теме
Комментарии
Автор

Clarification is very easy and trainer has explained very well

ashlehsashekhawat
Автор

Thank you Anubhav. Cannot wait for the second part. Thank you for everything

Rambodizzle
Автор

Thanks Sir...I will try to implement in my project

sujoydas
Автор

Typo error: JavaScript is synchronous and single-threaded language.

gv_krishna