Try http://spion.github.io/promise-nuggets - its not complete yet but the main concepts are covered
--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
we all of this I still can not figure out how to take an async function and change it from callback to a promise.
1. Do I have to declare a promise before I can call a 'then' on it? Every time I do not and call a then on an async function, I get a syntax error.
On Friday, October 18, 2013 3:11:47 PM UTC-7, Reza Razavipour wrote:I am a fairly new to javaScript and node.js both.I am trying to wrap my head around promises and I am having a hard time. I am looking for a very simple tutorial/video on this topic and having little success.Is there a reference that can be recommended? A before and after code snippet can be a good starting position.Reza
--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
---
You received this message because you are subscribed to a topic in the Google Groups "nodejs" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/nodejs/Fx_SjgkXvKU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to nodejs+un...@googlegroups.com.
var myAsyncFunction = function(err, result) {
if (err)
console.log("We got an error");
console.log("Success");
};
myAsyncFunction().then(function () { console.log("promise is working"); });
myAsyncFunction().then(function () { console.log("it really worked"); });
^
TypeError: Cannot call method 'then' of undefined
How do I turn myAsyncFunction into a promise?