inheriting from promise

16 views
Skip to first unread message

Jeff

unread,
May 19, 2020, 5:53:12 AM5/19/20
to Zakas Books
Hi Nicolas,  

On page 236, the example of a MyPromise class inheriting from promise, it says "The success() method mimics resolve() and failure() mimics the reject() method." whereas I would say success simulates then,  and failure simulates catch. 

It would be great if you could explain it in detail. thanks

Nicholas Zakas

unread,
May 19, 2020, 10:48:23 AM5/19/20
to zakas...@googlegroups.com
You are correct. It’s possible you’re reading an older copy of the book because this issue was fixed in a later version. You can see the latest here:

--
You received this message because you are subscribed to the Google Groups "Zakas Books" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zakasbooks+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/zakasbooks/b4eb58e1-0a85-40e1-bd74-2fece4feb8bb%40googlegroups.com.

Jeff

unread,
May 19, 2020, 9:43:37 PM5/19/20
to Zakas Books
thanks


On Tuesday, May 19, 2020 at 10:48:23 PM UTC+8, Nicholas C. Zakas wrote:
You are correct. It’s possible you’re reading an older copy of the book because this issue was fixed in a later version. You can see the latest here:
On Tue, May 19, 2020 at 2:53 AM Jeff <zhenzh...@gmail.com> wrote:
Hi Nicolas,  

On page 236, the example of a MyPromise class inheriting from promise, it says "The success() method mimics resolve() and failure() mimics the reject() method." whereas I would say success simulates then,  and failure simulates catch. 

It would be great if you could explain it in detail. thanks

--
You received this message because you are subscribed to the Google Groups "Zakas Books" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zakas...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages