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.
Tags
The Dangers of False Interpretations When Using the Promises API
Source: Trends Pinoy
0 Comments