Interactive promises

Interactive promises are extended promises that add more value to the paradigm by adding two more functions to its arsenal, get and call:

  • get(propertyName): This function requests the given property from the target of promise. This also returns a promise to provide the value of the stated property from promise's target.
  • call(functionName, arg1, arg2…): This function requests to call the given method/function on the target of promise. It also returns a promise to provide the return value of the requested function call.

Get Mastering JavaScript Promises now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.