-
Notifications
You must be signed in to change notification settings - Fork 104
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
Smaller build-up to promises? #14
Comments
new Promise((resolve, reject) => {
- if (false) {
- reject(error);
+ if (error) {
+ reject(false);
}
resolve(true);
});
- }); Oh, I see now. I should have read more carefully. This diff misses your intent. However it also muddies the common pattern we want them to use when writing their own Promise executors: new Promise((resolve, reject) => {
if (error) {
reject(error);
}
resolve(true);
}); |
I like this idea. |
Agreed, my intent is simply to show them the guts of a promise. THEN introduce what I've been calling the "catalyst function" that determines whether or not the original promise is resolved or rejected... |
I think I do something like this in the delivery. @raq929, will you add our discussion of this issue to delivery notes and then ping @payne-chris-r? Many thanks. |
setTimeout
<-- so the call takes awhilefs.writeFile
instead ofsetTimeout
.then()
The text was updated successfully, but these errors were encountered: