Promises

Promises came about as a response to the callback hell problem described in the previous section. They have quite a long history, stretching back to the early 80s, when the legendary Barbara Liskov coined the term Promise. The idea of a Promise is to flatten out async code. A promise is said to have the following states:

  • Pending: This means it has not yet been decided or that the data is not available yet
  • Fulfilled: The data has come back
  • Rejected: An error happened during the operation
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.116.62.239