paint-brush
The Dangers of False Interpretations When Using the Promises APIby@artyms
329 reads
329 reads

The Dangers of False Interpretations When Using the Promises API

by Artsem4mNovember 23rd, 2021
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

The majority of applications written in JS nowadays use at least a few calls of Promises API. Promises have an API which can lead to incorrect interpreting of potential results. This is mostly related to classic es5 promise realization, but, alas, also affects *async/await* promises realization. To avoid this behavior, we need to pass 2 callbacks(error callback, success callback) into then block in the correct order, which feels harder to read. The responsible code is less explicit and readable than dangerous code.

Coin Mentioned

Mention Thumbnail
featured image - The Dangers of False Interpretations When Using the Promises API
Artsem HackerNoon profile picture
Artsem

Artsem

@artyms

Fullstack Architect

About @artyms
LEARN MORE ABOUT @ARTYMS'S
EXPERTISE AND PLACE ON THE INTERNET.
L O A D I N G
. . . comments & more!

About Author

Artsem HackerNoon profile picture
Artsem@artyms
Fullstack Architect

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite