Timeline for How do I access previous promise results in a .then() chain?
Current License: CC BY-SA 3.0
5 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Aug 11, 2015 at 19:01 | history | edited | Anthony | CC BY-SA 3.0 |
deleted 35 characters in body
|
| Aug 11, 2015 at 19:00 | comment | added | Anthony | I don't need it personally in my own code, but the user may need to run more async in the second function and then interact with the original Promise call. But like mentioned, I'll be using generators in this case. :) | |
| Aug 11, 2015 at 18:56 | comment | added | Bergi |
In your case, the pattern seems to be useless though. You don't need a globalVar at all, just do User.findAsync({}).then(function(users){ console.log(users); mongoose.connection.close() });?
|
|
| Aug 11, 2015 at 18:56 | comment | added | Bergi | Notice that this pattern is already detailed in the Mutable contextual state answer (and also why it is ugly - I'm not a big fan either) | |
| Aug 11, 2015 at 18:35 | history | answered | Anthony | CC BY-SA 3.0 |