You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What you're looking for is .done(). So the example would be:
P().then(function(port){throw'boom!';}).done();
.done can also be used instead of .then when you don't plan to do anything with the returned promise. Think of .then like array.map and .done like array.forEach.
TLDR; I believe an example like this should be added to the README,
Hi,
I ve decided today to start learning promise, i was still stuck into streams ; 0
I would just like to share with you my little experiment to improve the README.
I wrote some shit like this
Which bugs in
if (!(port).match(/[^:]+:[^:]+/)) port = host + ':' + port;
becauseport
is anint
, butmatch
belong toString
.Anyway, the fact is the error was caught by the promise, and did not produce any output.
So i was kind of like
wtf ?!
for a while...Maybe i misread the
README
and missed something, but i believe it worth to show somewhere something likejust to let me people come in and fail in a friendly way while learning and developing.
The text was updated successfully, but these errors were encountered: