Skip to content

Instantly share code, notes, and snippets.

@briancavalier briancavalier/when-args.md
Last active Aug 29, 2015

Embed
What would you like to do?
// Before fold-related changes
Handler.prototype.when(resolve, notify, context, receiver, onFulfill, onReject, onProgress);

Params:

  • resolve - continuation function called by the promise machinery (technically by FulfilledHandler or RejectedHandler) with the result of either onFulfilled or onRejected. Sends values or errors on to the next handler in the chain.
  • notify - continuation function called with the result of onProgress. Sends progress values on to the next handler in the chain.
  • context - thisArg that will be used when calling resolve and/or notify
  • receiver - thisArg that will be used when calling onFulfill, onReject, or onProgress
  • onFulfill - function to call with the fulfillment value of the handler's associated promise. May return either a value or a promise, or may throw.
  • onReject - function to call with the fulfillment value of the handler's associated promise. May return a either a value or a promise, or may throw.
  • onProgress - function to call with progress update values sent to the handler's associated promise
// After fold-related changes
Handler.prototype.when(resolve, notify, context, receiver, arg, onFulfill, onReject, onProgress);

Additional param:

  • arg - (any type) additional argument to pass through to be provided to onFulfill, if not nil.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.