Skip to main content

PromiseObject placeholder for async operation & eventual Settled result

container for async delivered value

container for a future value

proxy for unknown value from async action, used to defer return value (success or fail) to future

Promise Lifecycle

(model) Promise process to start as Pending & end Settled into Fullfill || Reject

Promise Combinator

Promise.all()

Promise.race()

to set Race Condition to return first Promise to Settled

Promise.any()

Promise.allSettled()

References

  1. Fetch APIWeb API to Data Fetch Web Resource via async Promise

  2. Promise Lifecycle ↔ (model) Promise process to start as Pending & end Settled into Fullfill || Reject

  3. Consume ↔ (process) to use Settled Promise to get a result

  4. awaitJS Keyword to suspend execute JS code portion until Promise Settled & returns result

  5. async functionJS Keyword to Declare function with Asynchronous Code to return Promise & allow await inside

  6. .json()async Chain Method to return Promise parse as JSON format

  7. import()JS Operator to Dynamically load Module via Promise

  8. Promise.race() ↔ to set Race Condition to return first Promise to Settled

  9. .then()async Chain Method to execute Callback on Fullfill, auto-pass Promise Value as arg

  10. .catch()Chain Callback to handle Promise Error propagation

  11. fs-extraNode Lib extends fs with Promise-based functions that cut down on Boilerplate