-
-
Notifications
You must be signed in to change notification settings - Fork 596
Allow ES6-style Promise construction #154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Part of the launch checklist for #136 |
Also added the following static constructors from the ES6 spec: Parse.Promise.resolve(value);
Parse.Promise.resolve(thenable); // Chains the new promise to the end of the old one, essentially a noop
Parse.Promise.reject(error); |
@@ -26,11 +26,15 @@ var isPromisesAPlusCompliant = true; | |||
* @constructor | |||
*/ | |||
export default class ParsePromise { | |||
constructor() { | |||
constructor(closure) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we use executor
as param name for consistency?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 absolutely. I was calling it "closure" before I read the spec and determined it was deemed an "executor"
LGTM. |
Allow ES6-style Promise construction
Allows Parse.Promises to be constructed in the ES6 "executor" style, without intervening with old construction.
cc @grantland