Promisify functions and avoid callback hell | async javascript

preview_player
Показать описание
In this video we look into the process to promisify functions so that we do not need to work with callbacks, instead we work with javascript promises. We create a promisify function as a wrapper and then pass the original function to it and get a promisified function in return. This promisified function returns us a promise with which we can do the usual stull like .then() or async await.

Timestamps:
00:00:26 - Callbacks
00:01:42 - Promisifying
00:03:27 - Testing
00:04:16 - Async await

Check out our other popular videos:

1. Learn about public-key cryptography

2. maximum substring in a string (Google interview question)

3. How the javascript engine works?

4. Real time median in a stream, another google interview question

5. Understand the Javascript event loop

6. Understand Promises in javascript

7. Git basics you must know

My Socials:

Music By: "After The Fall"
Track Name: "Pieces (Extended Version)"
License: Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
Licence: Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)

#javascript #function #promisified
Рекомендации по теме
Комментарии
Автор

Awesome info! Looking forward to your next topics; keep up the good work!

codycodes
Автор

Super helpful and well explained, thank you for making this video! Keep up the good work, friend

joseperazah.
Автор

Same low quality programming as always! Did you have to return two nested functions???

saeeduchiha
Автор

this is nice!
However, why do you need to return a function on line 10?
if you don't than you get a promise as a result and not a function that returns a promise.

artiomoganesyan
Автор

await' is only allowed within async functions, need to be wrapped into

kmylodarkstar
visit shbcf.ru