Skip to content

Latest commit

 

History

History
14 lines (8 loc) · 645 Bytes

Promises.md

File metadata and controls

14 lines (8 loc) · 645 Bytes

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise

The Promise object represents the eventual completion (or failure) of an asynchronous operation and its resulting value.

A promise is a wrapper for an unknown value that will resolve to a value in the future. This is somewhat like observables in RxJS.

A Promise is in one of these states:

  • pending: initial state, neither fulfilled nor rejected.
  • fulfilled: meaning that the operation was completed successfully.
  • rejected: meaning that the operation failed.

Promises are chainable with their then, catch, and finally methods.